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

[bug] unhandledPromiseRejection in ZwaveClient.stopInclusion #959

Closed
AlCalzone opened this issue Mar 27, 2021 · 1 comment · Fixed by #979
Closed

[bug] unhandledPromiseRejection in ZwaveClient.stopInclusion #959

AlCalzone opened this issue Mar 27, 2021 · 1 comment · Fixed by #979
Assignees
Labels
bug Something isn't working

Comments

@AlCalzone
Copy link
Member

The corresponding controller method in zwave-js may throw/reject, but not all code paths in zwavejs2mqtt guard against that.

https://sentry.iobroker.net/share/issue/339ad2d6f7b4468aaae2bbe404cdce19/

Call sites which may throw:

  • ZwaveClient.prototype.replaceFailedNode -> setTimeout
  • ZwaveClient.prototype.startInclusion -> setTimeout
@AlCalzone AlCalzone added the bug Something isn't working label Mar 27, 2021
@AlCalzone
Copy link
Member Author

AlCalzone commented Mar 30, 2021

stopExclusion is also affected. This is being called from a timer:

ZwaveClient.prototype.stopExclusion = async function () {
  if (this.driver && !this.closed) {
    if (this.commandsTimeout) {
      clearTimeout(this.commandsTimeout)
      this.commandsTimeout = null
    }
    return this.driver.controller.stopExclusion()
  }
}

robertsLando added a commit that referenced this issue Mar 31, 2021
* fix: prevent stopInclusion/Exclusion to throw

Fixes #959

* fix: lint issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants