Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard crashing on "integer" selection. #748

Closed
7 tasks
Ryonez opened this issue Jan 15, 2022 · 3 comments
Closed
7 tasks

Dashboard crashing on "integer" selection. #748

Ryonez opened this issue Jan 15, 2022 · 3 comments

Comments

@Ryonez
Copy link

Ryonez commented Jan 15, 2022

I updated various nodes today, one of which was the dashboard. Since doing so, I've encountered an issue with a dropdown selector.

The dropdown node is being given this:
image

Selecting the string works, but errors out down the line (Isn't actually processed). However, selecting the value that is desired, in this case 79403379 cashes node Red 90+% of the time with the following error:

16 Jan 01:08:42 - [error] TypeError: Cannot read properties of undefined (reading 'indexOf')
    at Object.convertBack (/data/node_modules/node-red-dashboard/nodes/ui_dropdown.js:145:84)
    at EventEmitter.handler (/data/node_modules/node-red-dashboard/ui.js:280:29)
    at EventEmitter.emit (node:events:402:35)
    at Socket.emit (node:events:390:28)
    at Socket.emitUntyped (/data/node_modules/socket.io/dist/typed-events.js:69:22)
    at /data/node_modules/socket.io/dist/socket.js:466:39
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

The times it doesn't crash, it passes undefined as the payload.
Even with striping the msg object right back, it still errors:

image

16 Jan 01:45:36 - [error] TypeError: Cannot read properties of undefined (reading 'indexOf')
    at Object.convertBack (/data/node_modules/node-red-dashboard/nodes/ui_dropdown.js:145:84)
    at EventEmitter.handler (/data/node_modules/node-red-dashboard/ui.js:280:29)
    at EventEmitter.emit (node:events:402:35)
    at Socket.emit (node:events:390:28)
    at Socket.emitUntyped (/data/node_modules/socket.io/dist/typed-events.js:69:22)
    at /data/node_modules/socket.io/dist/socket.js:466:39
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

What are the steps to reproduce?

Pass a msg with msg.options set. The first option is a string, the rest is a list of integers.
Select one of the integers from the drop down box.

What happens?

Node red crashes with an exception.

What do you expect to happen?

For the dropdown box to pass the selected integer along as the msg.payload.

Please tell us about your environment:

  • Node-RED-Dashboard version: 3.1.4
  • Node-RED version: 2.1.5
  • node.js version: 16.13.1
  • npm version: 8.1.2
  • Platform/OS: unRaid 6.9.2
  • Browser: Vivaldi
  • Docker Image: nodered/node-red:latest-16
@dceejay
Copy link
Member

dceejay commented Jan 17, 2022

Hi Can you share your actual test flow here with some real data. If I set up a simple test it is working fine here.

@Ryonez
Copy link
Author

Ryonez commented Jan 18, 2022

I don't really have a test flow. I have made something similar though that causes the same bug.

[
    {
        "id": "679587e1f68b323f",
        "type": "function",
        "z": "66ad11c2.43e1e",
        "name": "Limit Search Results",
        "func": "const limitresults = [ 'Null (To force refresh)', 123456, 654321 ];\nmsg = {},\n//msg.payload = limitresults;\nmsg.options = limitresults;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 347,
        "y": 3747,
        "wires": [
            [
                "ad3723b7cad1b9fa"
            ]
        ]
    },
    {
        "id": "ad3723b7cad1b9fa",
        "type": "ui_dropdown",
        "z": "66ad11c2.43e1e",
        "name": "Create Result Dropdown Selector",
        "label": "",
        "tooltip": "",
        "place": "Select a File ID",
        "group": "6a98015b.12d9d8",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "multiple": false,
        "options": [],
        "payload": "",
        "topic": "topic",
        "topicType": "msg",
        "className": "",
        "x": 659,
        "y": 3743,
        "wires": [
            [
                "b229cf3d470b80da"
            ]
        ]
    },
    {
        "id": "b229cf3d470b80da",
        "type": "debug",
        "z": "66ad11c2.43e1e",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 931,
        "y": 3757,
        "wires": []
    },
    {
        "id": "c736f43f1a68658d",
        "type": "inject",
        "z": "66ad11c2.43e1e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 124.5,
        "y": 3725,
        "wires": [
            [
                "679587e1f68b323f"
            ]
        ]
    },
    {
        "id": "6a98015b.12d9d8",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "4f556f69.34e7f",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "4f556f69.34e7f",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

@dceejay
Copy link
Member

dceejay commented Jan 18, 2022

excellent - that does indeed break it - 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

No branches or pull requests

2 participants