[PR #4590] [MERGED] Fix authorize race condition by not updating the user on token refresh #4294

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4590
Author: @advplyr
Created: 8/13/2025
Status: Merged
Merged: 8/13/2025
Merged by: @advplyr

Base: masterHead: fix_authorize_race_condition


📝 Commits (1)

  • 2c45b28 Fix authorize race condition by not updating the user on token refresh #4567

📊 Changes

4 files changed (+5 additions, -6 deletions)

View changed files

📝 client/layouts/default.vue (+1 -1)
📝 client/pages/login.vue (+1 -1)
📝 client/store/libraries.js (+3 -3)
📝 client/store/user.js (+0 -1)

📄 Description

Brief summary

Fixes a race condition happening when refreshing the access token on initial page load.

Which issue is fixed?

Fixes #4567

In-depth Description

When refreshing the access token on /api/authorize the response from the /auth/refresh is updating the user. This user update is triggering the user watcher in login.vue before the default library id is set.

There is no reason to update the user from the token refresh response so that is removed


🔄 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/4590 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 8/13/2025 **Status:** ✅ Merged **Merged:** 8/13/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_authorize_race_condition` --- ### 📝 Commits (1) - [`2c45b28`](https://github.com/advplyr/audiobookshelf/commit/2c45b28d480409a6e5d0e39895cbb81376a5ee44) Fix authorize race condition by not updating the user on token refresh #4567 ### 📊 Changes **4 files changed** (+5 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `client/layouts/default.vue` (+1 -1) 📝 `client/pages/login.vue` (+1 -1) 📝 `client/store/libraries.js` (+3 -3) 📝 `client/store/user.js` (+0 -1) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Fixes a race condition happening when refreshing the access token on initial page load. ## Which issue is fixed? Fixes #4567 ## In-depth Description When refreshing the access token on `/api/authorize` the response from the `/auth/refresh` is updating the user. This user update is triggering the user watcher in `login.vue` before the default library id is set. There is no reason to update the user from the token refresh response so that is removed --- <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:10 +02:00
adam closed this issue 2026-04-25 00:19:10 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4294