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

TypeError when removing a node #4

Open
vexofp opened this issue Jul 14, 2024 · 1 comment
Open

TypeError when removing a node #4

vexofp opened this issue Jul 14, 2024 · 1 comment

Comments

@vexofp
Copy link

vexofp commented Jul 14, 2024

When a node is removed, an error like the following may occur:

2024-07-14 17:54:47.153 INFO Z-WAVE: Calling api startExclusion with args: [ [length]: 0 ]
2024-07-14 17:54:47.164 INFO Z-WAVE: Controller status: Exclusion started
2024-07-14 17:54:47.164 INFO Z-WAVE: Success zwave api call startExclusion true
2024-07-14 17:55:02.677 INFO Z-WAVE: Controller status: Exclusion stopped
2024-07-14 17:55:02.684 INFO Z-WAVE: [Node 029] Removed, reason: 0
2024-07-14 17:55:02.685 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'remove')
TypeError: Cannot read properties of undefined (reading 'remove')
    at ZwavejsProm.onNodeRemoved (/var/lib/zwave/node_modules/@kvaster/zwavejs-prom/index.js:90:25)
    at ZwaveClient.emit (node:events:514:28)
    at ZwaveClient._removeNode (/var/lib/zwave/node_modules/zwave-js-ui/server/lib/ZwaveClient.js:3768:18)
    at ZwaveClient._onNodeRemoved (/var/lib/zwave/node_modules/zwave-js-ui/server/lib/ZwaveClient.js:3132:14)
    at ZWaveController.emit (node:events:526:35)
    at ZWaveController.handleRemoveNodeStatusReport (/var/lib/zwave/node_modules/zwave-js/src/lib/controller/Controller.ts:4375:10)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Driver.handleRequest (/var/lib/zwave/node_modules/zwave-js/src/lib/driver/Driver.ts:4772:22)
    at Driver.handleUnsolicitedMessage (/var/lib/zwave/node_modules/zwave-js/src/lib/driver/Driver.ts:4211:5)

For me, this seems to happen 100% of the time after removing a node.

This causes the driver to become confused, thinking that exclusion mode is still active when it is not. A restart is required to fix it.

@vexofp
Copy link
Author

vexofp commented Jul 14, 2024

In onNodeRemoved(), I think perhaps for (const v in n.values) should be for (const v of Object.values(n.values))?

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

1 participant