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

MQTT nodes show 'disconnected' if 'birth message' or 'will message' topic contains a '#' (pound sign) #3557

Closed
juggledad opened this issue Apr 28, 2022 · 1 comment · Fixed by #3563

Comments

@juggledad
Copy link
Contributor

juggledad commented Apr 28, 2022

Current Behavior

MQTT nodes continously show 'disconnected' if the topic for Messages sent on connection (birth message) or Message sent on an unexpected disconnection (will message) contains a # (pound sign)

Expected Behavior

The node should be connecting so a '#' in the (birth message) or (will message) should not be allowed.

Steps To Reproduce

  1. edit an MQTT node (in or out)
  2. edit Server
  3. select Messages tab
  4. in Messages sent on connection (birth message) or Message sent on an unexpected disconnection (will message) put a # (pound sign) in the topic
  5. save changes and deploy

Example flow

[{"id":"c3c4b45a.8f11d8","type":"mqtt in","z":"777c09a8.492b88","name":"","topic":"et_call/home","qos":"2","datatype":"json","broker":"651a28b4.295b08","nl":false,"rap":false,"rh":"0","x":140,"y":40,"wires":[["9897b0a5.8754f8"]]},{"id":"651a28b4.295b08","type":"mqtt-broker","name":"","broker":"mqttpizw.local","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"#","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}
]```


### Environment

- Node-RED version: 1.3.5, 2.0.2 and 2.2.2
- Node.js version: 14.16.0
- npm version: 6.14.11 (mac) 6.14.13 (rpi) 
- Platform/OS: macOS and Rpi
- Browser: Safari
@Steve-Mcl
Copy link
Contributor

Hi Paul, quick update to let you know I have resolved your issue (by preventing bad publish topics being sent) but have been working on a deeper underlying issue regarding MQTT client connections hanging around in memory and firing events - this was discovered during my testing & was indirectly due to the publishing of a bad birth topic.

A fix will be incoming before too long (just tiding it up, removing the reams and reams of debug messages etc).

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