Repository navigation
fix(gitlab): recover after token refresh failure - #1
Open
jackspiece wants to merge 1 commit into
Open
jackspiece wants to merge 1 commit into
jackspiece wants to merge 1 commit into
Conversation
jackspiece
marked this pull request as ready for review
October 4, 2026 16:04
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The GitLab backend clears
refreshedTokenPromiseonly after a successful refresh. If the refresh rejects, that rejected promise remains cached. Later refresh attempts, token readers, and API requests can keep receiving the same rejection without trying the token endpoint again.Move cleanup into
finallyso concurrent callers still share one in-flight refresh, while a later request can recover after a temporary failure. The original rejection is preserved, and credentials are updated only on success.Regression coverage
Before the production fix, the concurrency-success control passed and both recovery regressions failed. All three pass with the fix.
Verification
pnpm run test:ci --runInBand: lint, formatting, TypeScript, four Cypress-runner unit checks, and Jest passed.pnpm --filter decap-cms-backend-gitlab run build:esm: 6 files compiled.git diff --checkpassed.Tested locally with Node 24.19.0 and pnpm 11.12.0. Cypress-runner unit checks do not launch browser E2E tests.
Remote CI on commit
570a9170b79d9e180a3e4d7a83e1e07b3837aca5passed all four build-unit jobs: Ubuntu with Node 22 and 24, macOS with Node 24, and Windows with Node 24. Workflow run.The E2E build is queued waiting for the workflow's
depot-ubuntu-24.04runner label, with no runner assigned at the latest check. Browser E2E and live GitLab remain unverified.Review base
This pull request is ready for review in this fork. Merge remains blocked until the exact-head browser E2E gate completes. The base branch is pinned to upstream commit
1d5868347d3d8648d7d5f7f59fc1b46595881b29, so the diff contains only the two changed GitLab files. The fork'smainbranch is unchanged. This has not been submitted upstream or released.