eclipse-thingweb / eclipse-thingweb/node-wot
mqv:filter is silently ignored due to operator precedence bug
Open
binding-mqtt
bug
good first issue
- Dominant language
- TypeScript
- Stars
- 192
- Forks
- 100
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
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"
Contributor guide
Assessment
This issue has not been assessed yet.