[PR #16080] Fix race condition in SessionInfoWebSocketListener on disconnect #14521

Open
opened 2026-02-07 07:31:07 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/16080
Author: @ZeusCraft10
Created: 1/22/2026
Status: 🔄 Open

Base: masterHead: fix/16060-session-disconnect-race


📝 Commits (1)

  • 520497b Fix race condition in SessionInfoWebSocketListener on disconnect

📊 Changes

1 file changed (+21 additions, -1 deletions)

View changed files

📝 Jellyfin.Api/WebSocketListeners/SessionInfoWebSocketListener.cs (+21 -1)

📄 Description

Changes
This PR fixes a race condition where the client UI remains in a "Connected" state after disconnecting. It introduces a 1.5s delay in SessionInfoWebSocketListener when receiving a SessionsStop message, allowing the concurrent HTTP Disconnect request to propagate the SessionEnded event before the listener shuts down. This ensures the final "Idle" state is sent to the client.

Issues
Fixes #16060


🔄 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/jellyfin/jellyfin/pull/16080 **Author:** [@ZeusCraft10](https://github.com/ZeusCraft10) **Created:** 1/22/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/16060-session-disconnect-race` --- ### 📝 Commits (1) - [`520497b`](https://github.com/jellyfin/jellyfin/commit/520497bd66197ca34d4d9f23e10a406e8be806ae) Fix race condition in SessionInfoWebSocketListener on disconnect ### 📊 Changes **1 file changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Api/WebSocketListeners/SessionInfoWebSocketListener.cs` (+21 -1) </details> ### 📄 Description **Changes** This PR fixes a race condition where the client UI remains in a "Connected" state after disconnecting. It introduces a 1.5s delay in `SessionInfoWebSocketListener` when receiving a `SessionsStop` message, allowing the concurrent HTTP Disconnect request to propagate the `SessionEnded` event before the listener shuts down. This ensures the final "Idle" state is sent to the client. **Issues** Fixes #16060 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:31:07 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14521