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
Option to disable MQTT topic unsubscribe on disconnect #4078
Merged
knolleary
merged 5 commits into
node-red:dev
from
flying7eleven:option-to-disable-mqtt-ubsubscribe-on-disconnect
Mar 20, 2023
Merged
Option to disable MQTT topic unsubscribe on disconnect #4078
knolleary
merged 5 commits into
node-red:dev
from
flying7eleven:option-to-disable-mqtt-ubsubscribe-on-disconnect
Mar 20, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The tests had an unused property called autoUnsubscribe. I refactored the code to use this wording too.
Steve-Mcl
reviewed
Mar 7, 2023
packages/node_modules/@node-red/nodes/core/network/10-mqtt.html
Outdated
Show resolved
Hide resolved
Steve-Mcl
reviewed
Mar 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks well written. thanks for the contribution.
@knolleary happy to merge if you are.
Thanks @Steve-Mcl . I updated the code according to your suggestion. Thank you for your advice! |
Thanks @flying7eleven |
6 tasks
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
I had an issue with QoS 1+ messages did not get delivered after re-connecting to the broker. After digging around I figured out that NodeRed automatically unsubscribes from topics before disconnecting. After searching for solutions I found the discussion in #3452. Unfortunately, there was no pull-request with the proposed changes attached to the issue. I figured to give it a try implementing it myself.
I am aware that I did not fulfill the
I have discussed this change on the forum/slack team
requirement and that this PR might be rejected, but since there was already an discussion on the issue going on, I thought to give it a shot.The only thing I couldn't figure out how to check if the node itself was removed from a flow. As you mentioned in the issue, it would still have to unsubscribe from the topics (even if the option is disabled) to prevent piling up messages which will never be collected by any client anymore.
Checklist
grunt
to verify the unit tests pass