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

Fix subscribe unsubscribe and then subscribe again MQTT issue #943

Merged
merged 3 commits into from
Mar 28, 2023

Conversation

relu91
Copy link
Member

@relu91 relu91 commented Mar 27, 2023

Fixes #942 (more explanations about the adopted solution on the commit messages).

When subscribing to a topic after unsubscribing from it, the subscription
is not performed until the client publish the `connect` event. Since it
was already connected with the first subscription the `connect` event
is not fired again. This commit fixes this issue by verifying if the
client is connected before subscribing to a topic.

Fixes eclipse-thingweb#942

Signed-off-by: reluc <relu.cri@gmail.com>
Currently the stop method does not correctly clean the previous subscriptions.
This causes the test "should publish and subscribe" to fail because it
receives the message sent by the next test. This commit fixes the problem
by cleaning the subscription manually.

Signed-off-by: reluc <relu.cri@gmail.com>
@relu91
Copy link
Member Author

relu91 commented Mar 27, 2023

@ilovemilk , I added a small test but it would be nice to get also your feedback. Thank you!

Copy link
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The updated comment should be commited...

@ilovemilk
Copy link

@relu91 Works perfectly! Thank you very much.

@relu91 relu91 merged commit 31feb64 into eclipse-thingweb:master Mar 28, 2023
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 this pull request may close these issues.

Unable to subscribe-unsubscribe and then resubscribing in binding-mqtt
3 participants