mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1235] [MERGED] discovery::server: fix activeUser field of getInfo #1295
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/1235
Author: @dsheets
Created: 12/17/2023
Status: ✅ Merged
Merged: 9/14/2024
Merged by: @roderickvd
Base:
dev← Head:bugfix-discovery-server-getinfo-active-user📝 Commits (1)
81f4fb4discovery::server: fix activeUser field of getInfo📊 Changes
1 file changed (+23 additions, -8 deletions)
View changed files
📝
discovery/src/server.rs(+23 -8)📄 Description
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
activeUserfield 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 https://github.com/TimotheeGerber/spotify-connect/pull/4#discussion_r1428834453.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.