MQTTX icon indicating copy to clipboard operation
MQTTX copied to clipboard

[Bug] topic subscription merges foo/# with foobar/#

Open pinchy opened this issue 6 months ago • 7 comments

What did I do

Created a topic subscription in the format tray/# in order to subscribe to messages in the format tray/abcd1234/state tray/12cbac123/ping etc.

Note we have a seperate subscriptions setup for traybot/#

What happened

Messages of the format traybot/# are also being subscribed to

Expected

Expected result would be that traybot/# messages are ignored as they do not conform to the pattern tray/# ~it appears that the trailing / character is being ignored and that the subscription is instead tray# which is unexpected behaviour.~ (edit, see comment below)

Environment

  • OS: OS version, e.g. macOS Big Sur 11.1
  • MQTTX version, e.g. v1.5.0

More detail

Screenshot showing subscription and also one correct and one incorrect message. (Please note that the payloads, redacted as I don't have approval to share, do not contain the words "tray" anywhere) Screenshot 2024-08-16 at 3 11 15 PM Screenshot 2024-08-16 at 3 10 31 PM

pinchy avatar Aug 16 '24 05:08 pinchy