-
Notifications
You must be signed in to change notification settings - Fork 647
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
discovery::server: fix activeUser field of getInfo #1235
discovery::server: fix activeUser field of getInfo #1235
Conversation
Thanks! Yes this is a known shortcoming, nice to see something being done about it.
That would be nice. Do you want to handle that under this PR or a separate one? |
bump you think you can take a shot at updating the user on disconnect / reconnect? |
Hi, sorry for the delay. I might have some time to take a look at this next week. |
Don't use async Mutexes for short-lived locks like this. Use a normal |
bump @Finomnis is right. Could you change it accordingly? |
Nudging @dsheets - this would be a very worthwhile addition and only requires a bit of work... could you muster it and add to the changelog? Then we can merge! |
We're aiming for a 0.5 release next week. Would be great to get this in, if you could do the last touch-up. Thanks. |
The current active user was almost persisted and reported but wasn't. The handler for the discovery server is under an Arc so I introduced a Mutex to protect the username field and made setting the username and sending the credentials atomic so that every valid credential send corresponds to an active user update.
10aa77a
to
81f4fb4
Compare
Sorry for the absurd delay. I've changed the lock to |
Thanks! |
The current active user was almost persisted and reported but wasn't. The handler for the discovery server is under an Arc so I introduced a Mutex to protect the username field and made setting the username and sending the credentials atomic so that every valid credential send corresponds to an active user update.
There doesn't appear currently to be any way for this
activeUser
field to be reset back to the empty string when a user disconnects so one could argue that it's actually more broken now than before as it will keep reporting the last user to connect indefinitely instead of the user with a currently active session.If you're interested in this fix, I may take a look at clearing the value in the future.
This issue was reported by @TimotheeGerber in TimotheeGerber/spotify-connect#4 (comment).