fix: dispatch zeroconf addUser from the current user - #341
Merged
devgianlu merged 1 commit intoJul 29, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A device that loses its connect state registration cannot recover on its own. The app falls back to the local addUser path, handleAddUser answers OK without dispatching, and nothing happens. The device never registers again and the app sits on "Connecting..." forever until the daemon is restarted.
What makes it unrecoverable is the currentUser arm. When the request comes from the user already holding the session it returns OK without creating a session and without logging anything, so the one recovery signal the app does send is swallowed.
This drops that arm so a same user addUser rebuilds the session and registers the device again. The authenticatingUser arm stays, so retries sent while one is already in flight are still absorbed. librespot-java and librespot have no guard on the user already holding the session and rebuild on every addUser.
How I hit it: a daemon up 20 hours. A capture during a tap shows getInfo returning 200 with activeUser set, then addUser answered
{"status":101,"statusString":"OK"}repeatedly, while the log stayed empty and "accepted zeroconf" never appeared once in the whole run. Both sockets stayed up and the dealer kept its ping pong going, so the process was healthy. A restart fixed it instantly.There was a dealer reconnect earlier in the day but I believe it recovered, since a successful re registration is silent at info level and a failed put would have warned. My reading is that the registration was dropped later on the server side with nothing visible to the client, similar to librespot-org/librespot#247. Either way addUser is the signal the app uses to recover and it should not be swallowed. I had no API credential to confirm the device was gone from the cloud device list, so that part is inferred.