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

autoUnsubscribe option in mqtt broker node causing red triangles in editor #4291

Closed
colinl opened this issue Aug 21, 2023 · 5 comments
Closed
Labels

Comments

@colinl
Copy link
Contributor

colinl commented Aug 21, 2023

Current Behavior

Under some circumstances (not sure what) the option
"autoUnsubscribe": true,
can get added to mqtt broker nodes.
Once that line is in there, every time the browser is refreshed red triangles appear on the mqtt nodes using that config and an attempt to deploy brings up the misconfigured nodes warning. Opening the config node and clicking Update clears the triangles.
Refreshing the browser brings them back.

Expected Behavior

Either the autoUnsubscribe option should not get added, or it should not cause problems.

Steps To Reproduce

Not sure at the moment.

Example flow

No response

Environment

  • Node-RED version: 3.1.0-beta.4
  • Node.js version: 18.16.0
  • npm version: 9.5.1
  • Platform/OS: Raspbian OS Bullseye and Ubuntu 22.04
  • Browser: Edge and FF
@colinl
Copy link
Contributor Author

colinl commented Aug 21, 2023

It seems that the autoUnsubscribe option is added if the mqtt config node is opened, Update is clicked, and the flows deployed.

@colinl
Copy link
Contributor Author

colinl commented Aug 22, 2023

In the posts on https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/33 there was originally a suggestion that the problem also exhibits itself on NR 3.0.2, but it now appears that this is a different problem, so it now seems that the issue is related to the beta version.

@colinl
Copy link
Contributor Author

colinl commented Aug 25, 2023

Further information thanks to philosoma in the linked forum thread. If the client id is not empty then the problem does not appear. So it seems it is the combination of autoUnsubscribe presence with an empty clientid that triggers it.

@knolleary
Copy link
Member

Steps to reproduce:

  1. Add a new broker config node
  2. Untick 'clean session' - the client id field is highlighted as being in-error as unclean sessions require client id
  3. Tick 'clean session' - the client id field no longer shows error
  4. Enter a server address
  5. Close dialog
  6. Deploy
  7. Reload - the mqtt node shows an error

The cause is that when 'clean session' is unticked, it also shows the 'auto unsubscribe' field which defaults to being ticked. When clean session is unticked, the 'auto unsub' option is hidden, but left ticked. When the dialog is closed, the node configuration now has auto-unsub set to true - which the validator complains about when the editor is reloaded.

Need to look at the logic of auto-unsub. If it only applies to non-clean sessions, then we should force the value to false if clean session is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants