[PR #5662] [MERGED] PM-24565: Syncronize token refreshes to avoid duplicate requests #5949

Closed
opened 2025-11-27 00:17:36 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5662
Author: @david-livefront
Created: 8/7/2025
Status: Merged
Merged: 8/7/2025
Merged by: @david-livefront

Base: mainHead: PM-24565-syncronize-token-refreshes


📝 Commits (1)

  • c188677 PM-24565: Syncronize token refreshes to avoid duplicate requests

📊 Changes

9 files changed (+365 additions, -402 deletions)

View changed files

📝 network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClientImpl.kt (+4 -8)
network/src/main/kotlin/com/bitwarden/network/authenticator/RefreshAuthenticator.kt (+0 -63)
network/src/main/kotlin/com/bitwarden/network/interceptor/AuthTokenInterceptor.kt (+0 -54)
network/src/main/kotlin/com/bitwarden/network/interceptor/AuthTokenManager.kt (+104 -0)
📝 network/src/main/kotlin/com/bitwarden/network/retrofit/RetrofitsImpl.kt (+4 -8)
network/src/test/kotlin/com/bitwarden/network/authenticator/RefreshAuthenticatorTests.kt (+0 -120)
network/src/test/kotlin/com/bitwarden/network/interceptor/AuthTokenInterceptorTest.kt (+0 -139)
network/src/test/kotlin/com/bitwarden/network/interceptor/AuthTokenManagerTest.kt (+248 -0)
📝 network/src/test/kotlin/com/bitwarden/network/retrofit/RetrofitsTest.kt (+5 -10)

📄 Description

🎟️ Tracking

PM-24565

📔 Objective

This PR consolidates the access token logic into a single class and synchronized it to ensure we do not request token refreshes in rapid succession.

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 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/bitwarden/android/pull/5662 **Author:** [@david-livefront](https://github.com/david-livefront) **Created:** 8/7/2025 **Status:** ✅ Merged **Merged:** 8/7/2025 **Merged by:** [@david-livefront](https://github.com/david-livefront) **Base:** `main` ← **Head:** `PM-24565-syncronize-token-refreshes` --- ### 📝 Commits (1) - [`c188677`](https://github.com/bitwarden/android/commit/c188677f3fa765a65563c62969c33f5226f5673c) PM-24565: Syncronize token refreshes to avoid duplicate requests ### 📊 Changes **9 files changed** (+365 additions, -402 deletions) <details> <summary>View changed files</summary> 📝 `network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClientImpl.kt` (+4 -8) ➖ `network/src/main/kotlin/com/bitwarden/network/authenticator/RefreshAuthenticator.kt` (+0 -63) ➖ `network/src/main/kotlin/com/bitwarden/network/interceptor/AuthTokenInterceptor.kt` (+0 -54) ➕ `network/src/main/kotlin/com/bitwarden/network/interceptor/AuthTokenManager.kt` (+104 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/retrofit/RetrofitsImpl.kt` (+4 -8) ➖ `network/src/test/kotlin/com/bitwarden/network/authenticator/RefreshAuthenticatorTests.kt` (+0 -120) ➖ `network/src/test/kotlin/com/bitwarden/network/interceptor/AuthTokenInterceptorTest.kt` (+0 -139) ➕ `network/src/test/kotlin/com/bitwarden/network/interceptor/AuthTokenManagerTest.kt` (+248 -0) 📝 `network/src/test/kotlin/com/bitwarden/network/retrofit/RetrofitsTest.kt` (+5 -10) </details> ### 📄 Description ## 🎟️ Tracking [PM-24565](https://bitwarden.atlassian.net/browse/PM-24565) ## 📔 Objective This PR consolidates the access token logic into a single class and synchronized it to ensure we do not request token refreshes in rapid succession. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes [PM-24565]: https://bitwarden.atlassian.net/browse/PM-24565?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-27 00:17:36 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5949