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

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

Closed
pinchy opened this issue Aug 16, 2024 · 8 comments
Closed

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

pinchy opened this issue Aug 16, 2024 · 8 comments
Assignees
Labels
bug Something isn't working desktop MQTTX Desktop
Milestone

Comments

@pinchy
Copy link

pinchy commented Aug 16, 2024

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 pinchy added the bug Something isn't working label Aug 16, 2024
@pinchy
Copy link
Author

pinchy commented Aug 16, 2024

I deleted the subscription to traybot/# and the offending messages were not shown in the tray/# subscription. I recreated the traybot/# subscription and messages sent to the topic traybot/# were again shown in the tray/# subscription.

So it looks like that they're being "merged" somehow.

@pinchy
Copy link
Author

pinchy commented Aug 16, 2024

Yep confirmed.

can easily recreate the bug.

  1. create topic foo/#

  2. send message to foo/1/test and it subscribes correctly

  3. send message to foobar/1/test and it does not show (correct behaviour)

  4. create seperate topic foobar/#

  5. click on foo/# topic window

  6. send message to foobar/1/test and message now shows in foo/# window

Screenshot 2024-08-16 at 3 17 23 PM

@pinchy pinchy changed the title [Bug] topic subscription appears to ignore / character [Bug] topic subscription merges foo/# with foobar/# Aug 16, 2024
@ysfscream ysfscream self-assigned this Aug 19, 2024
@ysfscream ysfscream added the desktop MQTTX Desktop label Aug 19, 2024
@ysfscream ysfscream added this to the v1.11.0 milestone Aug 19, 2024
@ysfscream
Copy link
Member

Hi, sorry for my late reply. Thanks for your response, but I cannot reproduce your issue:

image

And I noticed your MQTTX version is outdated. Please upgrade to the latest version (https://mqttx.app/downloads) to use.

@pinchy
Copy link
Author

pinchy commented Aug 19, 2024

(Just want to say first that we love the product!)
Version updated. Was able to recreate on a new subscription to a new local mosquitto server instance (running on my computer). I've screenshotted each step.
0  version

1  single subscription foo message
2bcab0d75)
2  single subscription foobar message
3  double subscription foo message
4  double subscription foobar message

macOS 14.6.1
mosquito version 2.0.18
using mqtt version 3.1

@pinchy
Copy link
Author

pinchy commented Aug 19, 2024

Hi, sorry for my late reply. Thanks for your response, but I cannot reproduce your issue:
snip

Looks like you did recreate it... you've only got the "tray/#" subscription selected in the subscription list, so you should only be seeing "tray/#" messages in the message stream. However the "traybot/3/state" message appeared erroneously.
359135745-5ddb42ba-5c16-4e5f-b509-00e44e5f854a

@ysfscream
Copy link
Member

(Just want to say first that we love the product!)

Thanks so much! 💛

I'm sorry, I misunderstood this issue. I reproduced it, and it's caused by the filter function on the search method for the database. It's a BUG, and we will fix it in the next version. Thanks.

@pinchy
Copy link
Author

pinchy commented Aug 20, 2024

Happy days!

@ysfscream
Copy link
Member

Updated on https://github.com/emqx/MQTTX/releases/tag/v1.11.0. Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop MQTTX Desktop
Projects
Status: Done
Development

No branches or pull requests

2 participants