Skip to content

Fix( mqtt ) mqv filter operator precedence#1511

Open
jona42-ui wants to merge 1 commit intoeclipse-thingweb:masterfrom
jona42-ui:fix/binding-mqtt-mqv-filter-operator-precedence
Open

Fix( mqtt ) mqv filter operator precedence#1511
jona42-ui wants to merge 1 commit intoeclipse-thingweb:masterfrom
jona42-ui:fix/binding-mqtt-mqv-filter-operator-precedence

Conversation

@jona42-ui
Copy link
Copy Markdown
Contributor

use the logical OR operator (||) instead of nullish coalescing (??)

Fixes #1508

…llback

The nullish coalescing operator (??) only triggers on null or undefined,
not on empty strings. When the URL path is '/', pathname.slice(1) returns
'' which is falsy but not null/undefined, causing mqv:filter and mqv:topic
to be silently ignored.

Fixes eclipse-thingweb#1508

Signed-off-by: jona42-ui <jonathanthembo123@gmail.com>
@jona42-ui jona42-ui force-pushed the fix/binding-mqtt-mqv-filter-operator-precedence branch from 7289e7f to b6a6b9e Compare March 29, 2026 12:19
Copy link
Copy Markdown
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Changes look good. Do you mind adding two tests:

  1. Verify that the bug described in #1508 is solved
  2. Verify if the form has no path and no filter; the client throws an error.

I would add them both here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mqv:filter is silently ignored due to operator precedence bug

2 participants