Skip to content
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

Fix race condition in DefaultSocketApi causing disconnection loop when changing credentials #1022

Merged

Conversation

nielsvanvelzen
Copy link
Member

Whenever the socket connection is disconnected we automatically reconnect when there's still active subscriptions.
The reconnect function will always disconnect any existing connection before opening a new one.

Now guess what can go wrong: whenever you reconnect, it will trigger the automatic reconnect. This will cause a reconnection loop. This issue could be triggered in the ATV app by changing users, where it updates the credentials and a reconnect is attempted.

The fix was easy, never initiate the automatic reconnect when an reconnect is already happening.

Fixes jellyfin/jellyfin-androidtv#4225

@nielsvanvelzen nielsvanvelzen added the bug Something isn't working label Nov 19, 2024
@nielsvanvelzen nielsvanvelzen added this to the v1.6.4 milestone Nov 19, 2024
@nielsvanvelzen nielsvanvelzen merged commit 89d3146 into jellyfin:master Nov 19, 2024
11 checks passed
@nielsvanvelzen nielsvanvelzen deleted the socket-reconnect-loop branch February 8, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switching users in the app causes request loop
2 participants