-
-
Notifications
You must be signed in to change notification settings - Fork 80
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]: DuplicateDeviceError crashes library #167
Comments
Actually it seems to affect the homebridge plugin also. |
You're right about that. But the reason is also a race condition caused by this line in your test client. The I will fix it soon, but as I said, if you remove your refresh mechanism, this problem should no longer occur. |
Thank you for auditing. Yeah. Didn't check if refresh was really necessary and copied it from other sources nevertheless. As said quick and (very) dirty. But helps me a lot to test things and dive a little deeper. |
Same thing here. |
I have another question regarding this, since this means that one can not retrieve the station and device list right away. Alternatively, would it be feasible to emit an event after the first call to Lastly: if calling this method yourself is bad practice, wouldn't it be better to restrict access by setting it to private? (of course this would be breaking, but maybe it's a consideration worth making for the future) |
The
Right.
You could now also use the |
Client version
2.1.0
Node version
16.13
Operating System type
Linux
Operating system version
Debian
Describe the bug
See code snippet from eufysecurity.ts (lines 495 ff.):
and the corresponding addDevice method:
If the function throws a DuplicateDeviceError. This error is in sequence treated as a device itself (lines 509-511).
Since this error object doesn't have the needed methods for a device the following
loadingDevices
method will crash.To reproduce
I have this issue in my quick and dirty tool (https://github.com/thieren/eufy-test-client) even though I can't quite tell why.
The first login works fine but any subsequent attempt to connect crashes.
The homebridge-eufy-security client which establishes the connection just the same works fine it seems.
Screenshots & Logfiles
Additional context
No response
The text was updated successfully, but these errors were encountered: