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

Option to disable MQTT topic unsubscribe on disconnect #4078

Conversation

flying7eleven
Copy link
Contributor

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 27, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a 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.

@coveralls
Copy link

coveralls commented Mar 7, 2023

Coverage Status

Coverage: 68.578% (+0.07%) from 68.51% when pulling e7617de on flying7eleven:option-to-disable-mqtt-ubsubscribe-on-disconnect into 910f613 on node-red:dev.

@flying7eleven
Copy link
Contributor Author

Thanks @Steve-Mcl . I updated the code according to your suggestion. Thank you for your advice!

@knolleary
Copy link
Member

Thanks @flying7eleven

@knolleary knolleary merged commit 4667e76 into node-red:dev Mar 20, 2023
2 checks passed
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.

None yet

4 participants