[PR #5102] [CLOSED] fix: Retry socket authentication on auth failure #4426

Closed
opened 2026-04-25 00:19:42 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/5102
Author: @theluckystrike
Created: 3/4/2026
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 7ea0736 fix: Retry socket authentication on auth failure

📊 Changes

1 file changed (+12 additions, -0 deletions)

View changed files

📝 client/layouts/default.vue (+12 -0)

📄 Description

When socket authentication fails (e.g., race condition when token is not yet loaded from storage), the client now retries authentication after a short delay. This fixes the issue where:

  • Login page shows spinning icon forever
  • Playback fails with 'invalid token' errors
  • Socket stays unauthenticated after transient failures

The fix adds a 500ms retry delay that allows time for the token to become available (e.g., after hydration from localStorage).

Fixes #5101


Contributed by theluckystrike | Zovo


🔄 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/advplyr/audiobookshelf/pull/5102 **Author:** [@theluckystrike](https://github.com/theluckystrike) **Created:** 3/4/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`7ea0736`](https://github.com/advplyr/audiobookshelf/commit/7ea073611170483c7111a283d2869b89f097fbdf) fix: Retry socket authentication on auth failure ### 📊 Changes **1 file changed** (+12 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/layouts/default.vue` (+12 -0) </details> ### 📄 Description When socket authentication fails (e.g., race condition when token is not yet loaded from storage), the client now retries authentication after a short delay. This fixes the issue where: - Login page shows spinning icon forever - Playback fails with 'invalid token' errors - Socket stays unauthenticated after transient failures The fix adds a 500ms retry delay that allows time for the token to become available (e.g., after hydration from localStorage). Fixes #5101 --- *Contributed by [theluckystrike](https://github.com/theluckystrike) | [Zovo](https://zovo.one)* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:42 +02:00
adam closed this issue 2026-04-25 00:19:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4426