Skip to content

mqv:filter is silently ignored due to operator precedence bug #1508

@jona42-ui

Description

@jona42-ui

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-mqttIssues related to mqtt protocol bindingbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions