FlowFuse / FlowFuse/node-red-dashboard

ui-notification retains and emits properties from all previous messages

Open
#1,602 11 comments 0 reactions 0 assignees View on GitHub
needs-triage type:bug
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### Current Behavior

When sending a msg to ui-notification configured with manual confirmation/dismissal, any property that's set aside from `msg.payload` or `msg.topic` is retained and emitted any time the confirm or dismiss buttons are clicked, even when the incoming message that triggered the notification does not have that property.

### Expected Behavior

The output that's emitted from a notification when a confirm or cancel button is clicked should only contain the msg that was sent to it, with msg.payload modified per the node help info.

### Steps To Reproduce

Example flow:

Click the first inject node, then click confirm or close on the dashboard notification, then click the second inject node and click confirm or close and see that the extra properties from the first inject are being emitted every time. Removing the node and replacing the node does not help.

`[{"id":"fcf752aa7785e4fa","type":"inject","z":"df36d1113fdcc60e","name":"click first","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"extraProp","v":"foo bar","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":560,"y":660,"wires":[["9c5952c1756c5cb9"]]},{"id":"84bdee650d1a43df","type":"inject","z":"df36d1113fdcc60e","name":"click second","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":550,"y":700,"wires":[["9c5952c1756c5cb9"]]},{"id":"a16d019f36a00697","type":"debug","z":"df36d1113fdcc60e","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":940,"y":680,"wires":[]},{"id":"9c5952c1756c5cb9","type":"ui-notification","z":"df36d1113fdcc60e","ui":"4021fffb356dc9de","position":"center center","colorDefault":true,"color":"#000000","displayTime":"","showCountdown":true,"outputs":1,"allowDismiss":true,"dismissText":"Close","allowConfirm":true,"confirmText":"Confirm","raw":false,"className":"","name":"","x":750,"y":680,"wires":[["a16d019f36a00697"]]},{"id":"4021fffb356dc9de","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"navigationStyle":"default","titleBarStyle":"default"}]`

### Environment

- Dashboard version: 1.22.1
- Node-RED version: 4.0.8
- Node.js version: 20.18.1
- npm version: 10.8.2
- Platform/OS: Ubuntu 24.04.1 LTS
- Browser: chrome

### Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.