eclipse-thingweb / eclipse-thingweb/node-wot

mqv:filter is silently ignored due to operator precedence bug

Open
#1,508 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.