Db2 - notification widget stamps current msg with attributes of previous message

Hi

Below is my scenario

  1. I have button1 - i click it. It goes to function 55. Function 55 sets an attribute (msg.test) on msg.
  2. The msg goes to notification
  3. I see it in debug with msg.test. All good.
  4. Button 2 does the same. Goes to function 57. Sets another attribute (msg.text2). There is no msg.text attibute now on the msg.
  5. The msg goes to notification
  6. In debug , now i see both msg.test and msg.test2. Seems to me that on receiving a msg - internally - DB2 takes the previous msg and copies all non common attributes back to the current message.

(DB2 : 1.24.0. I know i am few versions behind. )

This seems incorrect. I believe even DB2 stores the message - it should be limited to the current message and some core attributes around client etc. And not add new attributes from the previous message to the current message.

Please suggest.

Below is a flow to reproduce the issue

[
    {
        "id": "b3e2625ee94a4fbf",
        "type": "ui-button",
        "z": "548370b28f3891ec",
        "group": "bf79ff83bcd41944",
        "name": "Test Btn",
        "label": "TestBtn",
        "order": 1,
        "width": 1,
        "height": "1",
        "emulateClick": false,
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "iconPosition": "left",
        "payload": "{\"groups\":{\"show\":[\"Mmap PSGN Configurator:Edit Configuration\"]}}",
        "payloadType": "json",
        "topic": "New",
        "topicType": "str",
        "buttonColor": "",
        "textColor": "",
        "iconColor": "",
        "enableClick": true,
        "enablePointerdown": false,
        "pointerdownPayload": "",
        "pointerdownPayloadType": "str",
        "enablePointerup": false,
        "pointerupPayload": "",
        "pointerupPayloadType": "str",
        "x": 392.22219467163086,
        "y": 1408.8888092041016,
        "wires": [
            [
                "6a2f87c3b6071e73"
            ]
        ]
    },
    {
        "id": "6a2f87c3b6071e73",
        "type": "function",
        "z": "548370b28f3891ec",
        "name": "function 55",
        "func": "msg.test={};\nmsg.test.x=\"bac1\";\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 626.6666259765625,
        "y": 1406.6666259765625,
        "wires": [
            [
                "603fa5def5030500",
                "f57aacae7efbe300"
            ]
        ]
    },
    {
        "id": "f57aacae7efbe300",
        "type": "ui-notification",
        "z": "548370b28f3891ec",
        "ui": "b922b9acf646fc95",
        "position": "center center",
        "colorDefault": true,
        "color": "#000000",
        "displayTime": "0",
        "showCountdown": true,
        "outputs": 1,
        "allowDismiss": true,
        "dismissText": "Edit & Save",
        "allowConfirm": true,
        "confirmText": "Discard",
        "raw": false,
        "className": "",
        "name": "",
        "x": 641.7777709960938,
        "y": 1452.7777099609375,
        "wires": [
            [
                "d0ad6ca06bfaafa5"
            ]
        ]
    },
    {
        "id": "d0ad6ca06bfaafa5",
        "type": "debug",
        "z": "548370b28f3891ec",
        "name": "debug 230",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 843.333251953125,
        "y": 1452.888916015625,
        "wires": []
    },
    {
        "id": "603fa5def5030500",
        "type": "debug",
        "z": "548370b28f3891ec",
        "name": "debug 231",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 836.3333129882812,
        "y": 1409.333251953125,
        "wires": []
    },
    {
        "id": "d3b24d578228cf12",
        "type": "ui-button",
        "z": "548370b28f3891ec",
        "group": "bf79ff83bcd41944",
        "name": "Test Btn2",
        "label": "TestBtn2",
        "order": 2,
        "width": 1,
        "height": "1",
        "emulateClick": false,
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "iconPosition": "left",
        "payload": "{\"groups\":{\"show\":[\"Mmap PSGN Configurator:Edit Configuration\"]}}",
        "payloadType": "json",
        "topic": "New",
        "topicType": "str",
        "buttonColor": "",
        "textColor": "",
        "iconColor": "",
        "enableClick": true,
        "enablePointerdown": false,
        "pointerdownPayload": "",
        "pointerdownPayloadType": "str",
        "enablePointerup": false,
        "pointerupPayload": "",
        "pointerupPayloadType": "str",
        "x": 397.6666564941406,
        "y": 1496.111083984375,
        "wires": [
            [
                "3e6670f14f3f39b3"
            ]
        ]
    },
    {
        "id": "3e6670f14f3f39b3",
        "type": "function",
        "z": "548370b28f3891ec",
        "name": "function 57",
        "func": "\nmsg.text2 = \"Test2\"\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 616.111083984375,
        "y": 1495.888916015625,
        "wires": [
            [
                "f57aacae7efbe300"
            ]
        ]
    },
    {
        "id": "bf79ff83bcd41944",
        "type": "ui-group",
        "name": "Group X",
        "page": "b9aecfe852b2855a",
        "width": 6,
        "height": 1,
        "order": 1,
        "showTitle": true,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "b922b9acf646fc95",
        "type": "ui-base",
        "name": "mmap",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control",
            "ui-button",
            "ui-table",
            "ui-tabulator",
            "ui-text",
            "ui-template",
            "ui-text-input",
            "ui-form",
            "ui-number-input",
            "ui-file-input",
            "ui-button-group",
            "ui-slider",
            "ui-switch",
            "ui-chart",
            "ui-gauge",
            "ui-audio",
            "ui-markdown",
            "ui-radio-group",
            "ui-dropdown"
        ],
        "showPathInSidebar": false,
        "headerContent": "page",
        "navigationStyle": "none",
        "titleBarStyle": "default",
        "showReconnectNotification": false,
        "notificationDisplayTime": 5,
        "showDisconnectNotification": false
    },
    {
        "id": "b9aecfe852b2855a",
        "type": "ui-page",
        "name": "Test Page",
        "ui": "b922b9acf646fc95",
        "path": "/page10",
        "icon": "home",
        "layout": "grid",
        "theme": "4ff3442d1cf69557",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "3"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Small Desktop",
                "px": "768",
                "cols": "9"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 11,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "4ff3442d1cf69557",
        "type": "ui-theme",
        "name": "Default Theme",
        "colors": {
            "surface": "#ffffff",
            "primary": "#0b87ff",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px"
        }
    }
]

It does look like a bug.
I reduced the flow to a single button
image

The issue is in the notification node, which sends 2 messages: the 1st when it is triggered, and the 2nd once it is confirmed/discarded.
The problem is with the second message: it overrides your original payload with the string confirm_clicked and indeed collects some extra garbage properties (I assume it's a D-2 datastore merge issue).

Until this is fixed, you can regard the 2nd message only as an event (which tells you that the notification was clicked), and just ignore any of its other properties (your original payload is lost anyway in the second message)

Probably related to The Dropdown node (and possibly others) does not discard previous messages sent to it when a new message is sent · Issue #1660 · FlowFuse/node-red-dashboard · GitHub

Yes. I read the issue today. Seems connected.