Skip to content

[2191] Error in Node SWITCH with preset On Payload/Off Payload - Buffer - #2212

Merged
cstns merged 1 commit into
mainfrom
2191-switch-on-off
Sep 11, 2026
Merged

[2191] Error in Node SWITCH with preset On Payload/Off Payload - Buffer#2212
cstns merged 1 commit into
mainfrom
2191-switch-on-off

Conversation

@n-lark

@n-lark n-lark commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

socket.io delivers Buffer payloads to the browser as ArrayBuffer, which all serialize to {}. So the switch could no longer tell the values apart and stayed On. Fixed by comparing the actual bytes.

Related Issue(s)

Resolves #2191

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@colinl

colinl commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@n-lark did you notice that @Amperum suggested that the same issue affects the ui-led node. I have not tested that. I don't know whether it may also affect other nodes.

@n-lark

n-lark commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Hey @colinl so I did an audit and a widget is affected only if it compares a payload client-side && the configured value can be a Buffer aka bin type.

Widget Compares? Allows bin? Verdict
ui-switch yes yes the bug — fixed
ui-button no yes safe (emits only)
ui-button-group yes no safe
ui-radio-group yes no safe
ui-dropdown yes no safe
others numeric/string n/a safe

ui-switch is the only affected node in this repo afaik. ui-led does seem to have the same bug. Raised LED does not match buffer (bin) state values #39 & added it to my backlog, will try to get it fixed soon.

@colinl

colinl commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Excellent. It is great to see progress on the dashboard again.

@cstns
cstns merged commit 72240d3 into main Sep 11, 2026
4 checks passed
@cstns
cstns deleted the 2191-switch-on-off branch September 11, 2026 10:53
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.

Error in Node SWITCH with preset On Payload/Off Payload - Buffer

3 participants