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

Topic match error: “sport/+” does not match “sport/” #219

Open
milabi opened this issue Dec 15, 2022 · 3 comments
Open

Topic match error: “sport/+” does not match “sport/” #219

milabi opened this issue Dec 15, 2022 · 3 comments
Assignees
Labels

Comments

@milabi
Copy link

milabi commented Dec 15, 2022

return t ? match() : false;

Should the above code be changed to

return t !== undefined ? match() : false; 

[For example, “sport/tennis/+” matches “sport/tennis/player1” and “sport/tennis/player2”, but not “sport/tennis/player1/ranking”. Also, because the single-level wildcard matches only a single level, “sport/+” does not match “sport” but it does match “sport/”.
jump to docs https://docs.oasis-open.org

@sclausen sclausen added the bug label Dec 16, 2022
@sclausen sclausen self-assigned this Dec 16, 2022
@sclausen
Copy link
Owner

Yes, you’re right. I’ll fix it.
Why didn’t I used those topics and filters for my tests? 🤔

@milabi
Copy link
Author

milabi commented Dec 22, 2022

I have a question. What is the purpose of this filter. The server already has a filter for filtering topics.

@sclausen
Copy link
Owner

Since the mqtt.js client will receive all messages for all subscribed topic filters, this code will ensure that only the messages matching the topic filter you created the specific observables with will be received. So you don't have to manually filter out the messages your specific component doesn't need.

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