[PR #1235] [MERGED] discovery::server: fix activeUser field of getInfo #1295

Closed
opened 2026-02-27 20:01:54 +03:00 by kerem · 0 comments
Owner

📋 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: devHead: bugfix-discovery-server-getinfo-active-user


📝 Commits (1)

  • 81f4fb4 discovery::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 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 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.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1235 **Author:** [@dsheets](https://github.com/dsheets) **Created:** 12/17/2023 **Status:** ✅ Merged **Merged:** 9/14/2024 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `bugfix-discovery-server-getinfo-active-user` --- ### 📝 Commits (1) - [`81f4fb4`](https://github.com/librespot-org/librespot/commit/81f4fb40dfe02cf4a3f359846ca1086ce5f6dc27) discovery::server: fix activeUser field of getInfo ### 📊 Changes **1 file changed** (+23 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `discovery/src/server.rs` (+23 -8) </details> ### 📄 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 `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 <https://github.com/TimotheeGerber/spotify-connect/pull/4#discussion_r1428834453>. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1295
No description provided.