-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[MqttServer] Subscription to similar base and subtopic with wildcards fails #1612
Comments
That indeed looks to be a bug. @chkr1011 I think this one is for me; I'll be looking into it if you like. |
@logicaloud Yes please have look. I will also have a look tomorrow or so. We can then join with our findings. |
@logicaloud Please us the branch created for this ticket. |
@chkr1011 Will do. I have found the issue and will add a pull request into the branch soon. @grobmiller, thanks for reporting this. |
You're welcome, thanx for your great effort and product! |
* fix wildcard topic subscription * Remove superfluous ToList calls
We encountered a bug which was not present in earlier major versions of MQTTnet, but we met it since we had a major upgrade to 4.1.2.350. Same applies for the newest version 4.1.2.436
We start an MQTTnet server. Then a client. We add a subscription to these to topics:
house/+/room
house/+/room/+
Then we send messages with these two topics:
house/1/room
house/1/room/bed
We would expect to receive both messages, but only the first one arrives. When testing this with other servers (older MQTTnet server or Moquitto) both messages arrive.
As you can see in the sample code below, we also made some slight variations (# instead of +), but no success. When we only use one subscription (#) everything is fine again. Replacing the mid-level wildcard with a concrete house id (1) also makes it work again.
It is not an ultra-critical bug, since there is a workaround. But we lost data in production since we did not realize this problem immediately. Might be that some others may stumble over this, too.
The text was updated successfully, but these errors were encountered: