-
Notifications
You must be signed in to change notification settings - Fork 99
mqv:filter is silently ignored due to operator precedence bug #1508
Copy link
Copy link
Open
Labels
binding-mqttIssues related to mqtt protocol bindingIssues related to mqtt protocol bindingbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
the mqv:filter is being "silently ignored" in cases where requestUri.pathname.slice(1) returns an empty string "" (which is falsy), but the nullish coalescing operator ?? only triggers on null or undefined, not on empty strings.
foexample:
URL: mqtt://broker.example.com/
Form has: { "mqv:filter": "sensors/+/temperature" }
Current behavior:
requestUri.pathname = "/"
requestUri.pathname.slice(1) = "" (empty string, not null/undefined)
filter = "" (mqv:filter is ignored!)
Expected behavior:
filter should be "sensors/+/temperature"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
binding-mqttIssues related to mqtt protocol bindingIssues related to mqtt protocol bindingbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers