jaxcksn / nanoleafMusic

Sync your Nanoleaf lights with Spotify!
BSD 3-Clause "New" or "Revised" License
28 stars 1 forks source link

Reconnection Bug on Windows Platform #14

Closed jaxcksn closed 2 years ago

jaxcksn commented 3 years ago

Describe the bug: When pressing reconnect on Windows, the program won't reconnect to the device unless a new access token is granted to the program (by pressing and holding down the power button).

Expected behavior: Pressing reconnect should use the saved access token.

Desktop:

Nanoleaf Device:

Additional context: Discovered in testing done for issue #12. I have a strong hunch this is related to the storage of reconnection data on the Windows platform, since it doesn't happen on MacOS.

jaxcksn commented 3 years ago

I can't reproduce the bug with Light Panels on Windows. It's kind of a strange bug because the program shouldn't run to the point where the successful reconnection dialog is shown if the access token, host or port is malformed because it won't be able to make a NLDevice object. Another thing that's strange is the remedy. Pressing the indicator for 5 seconds puts the device in an elevated state so that an access token can be requested from it. Only 1 endpoint is used with this elevated state, and nowhere in the reconnection code does it call that endpoint and pressing it when the endpoint isn't being called should not have any effect.

I'm thinking this might have been a 1-off issue with the API or device. Especially since it can't be reproduced on MacOS.