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

Pushing 'identify accessory' multiple times causes unhandled exception #2548

Closed
adriancable opened this issue Apr 28, 2020 · 8 comments
Closed

Comments

@adriancable
Copy link

Describe The Bug:
When adding an accessory, there is an 'Identify Accessory' button presented by iOS Home app. Pressing it multiple times caused an unhandled exception in Accessory.ts line 262 (the callback call inside _identificationRequest, underneath the 'identification request ignored' line).

To Reproduce:
See above.

Expected behavior:
No exception.

Logs:
Error: This callback function has already been called by someone else; it can only be called one time.
at /root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13
at Accessory._this._identificationRequest (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:262:7)
at Identify. (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:248:16)
at Identify.emit (events.js:323:22)
at Identify.EventEmitter.emit (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
at Identify.Characteristic._this.setValue (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:614:12)
at /root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1441:24
at Array.forEach ()
at Bridge.Accessory._this._handleSetCharacteristics (/root/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1283:10)
at HAPServer.emit (events.js:311:20)

Environment:

  • Node.js Version: 12.16.0
  • Operating System: Debian
@Supereg
Copy link
Member

Supereg commented Apr 28, 2020

Which version of homebridge are you running if I may ask? Look at the stack trace I assume you are running homebridge.

For what type of plugin does this occur, accessory or platform. It may be helpful if you could provide the plugin for which this caused the error.

@adriancable
Copy link
Author

adriancable commented Apr 28, 2020

@Superreg - homebridge 1.0.2.

The plug-in that this happens with isn't released yet, but I was assuming it wasn't plug-in specific. If you can't reproduce on an arbitrary plug-in, I'll try to create a minimal example.

The plug-in doesn't hook the 'identify' event in any way.

@Supereg
Copy link
Member

Supereg commented Apr 28, 2020

Alright, I gonna have a look at it tomorrow.

@NorthernMan54
Copy link
Contributor

@adriancable Can you share your code? ie check in to GitHub and share the REPO.

@adriancable
Copy link
Author

@NorthernMan54 - unfortunately I'd rather not - the plug-in that's under development has some proprietary bits that I can't share. If @Supereg can't simply reproduce, I'll try and produce a minimal example that demonstrates the issue.

@adriancable
Copy link
Author

Someone has reported the same issue with homebridge-nest here: #2542

@Supereg
Copy link
Member

Supereg commented Apr 29, 2020

The issue with the nest plugin is actually caused by some weird implementation of the plugin itself. See chrisjshull/homebridge-nest#245

Don't know if your issue somehow has a similar root cause. The nest issue is more related to homebridge and not to hap-nodejs. Would be great if you could check if that's the same issue or if it's something else. And also check to what it is related, if it's a homebridge problem we may move this issue to the homebridge repo.

@Supereg
Copy link
Member

Supereg commented Apr 29, 2020

As the issue that was fixed in homebridge@1.0.4-beta.2 (or rather mitigated) was caused by a malformed StaticPlatformPluign or AccessoryPlugin I would be very interested in the way your specific code causes the issue for you.

@Supereg Supereg transferred this issue from homebridge/HAP-NodeJS Apr 30, 2020
@Supereg Supereg closed this as completed Apr 30, 2020
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

3 participants