Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topicaliases.TAHandler does not send a topic on first publish #271

Open
shirou opened this issue Nov 1, 2024 · 0 comments · May be fixed by #272
Open

topicaliases.TAHandler does not send a topic on first publish #271

shirou opened this issue Nov 1, 2024 · 0 comments · May be fixed by #272

Comments

@shirou
Copy link

shirou commented Nov 1, 2024

Describe the bug

When using topicaliases.TAHandler to publish, the server disconnects. The ReasonCode is 0x82, indicating a Protocol Error.

I believe this issue occurs because the TAHandler does not send the topic when the alias does not exist, It should send the topic in the first publish.

To reproduce

	ta := topicaliases.NewTAHandler(maxTopicAlias)
	cliCfg := autopaho.ClientConfig{
		ConnectPacketBuilder: func(c *paho.Connect, u *url.URL) *paho.Connect {
			m := uint16(maxTopicAlias)
			c.Properties = &paho.ConnectProperties{
				TopicAliasMaximum: &m,
			}
			return c
		},
		ClientConfig: paho.ClientConfig{
		(snip)
			PublishHook: ta.PublishHook,
		},
	}

and Publish the message.

Expected behaviour

Server does not disconnect and publish successed.

Software used:

  • Server : AWS IoT Core
  • Client version : github.com/eclipse/paho.golang v0.21.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant