fix(gui): carry dashboard token prompt dedupe onto dig2-go (#651) - #676
Conversation
…e-jun#651) Fixes lidge-jun#647. Single shared 401 token refresh gate; no prompt storm on concurrent /api/* 401s.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0319a9f9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [retryInput, retryInit] = withToken(input, init, nextToken); | ||
| const retry = await originalFetch(retryInput, retryInit); | ||
| if (retry.status === 401) clearToken(); | ||
| if (retry.status === 401) clearTokenIfCurrent(nextToken); |
There was a problem hiding this comment.
Retry with a concurrently corrected token
When concurrent initial 401s retry a token that the user entered incorrectly, one request can clear that token while another request prompts for and stores a corrected token. Any old-token retry that then reaches this line preserves the corrected token but immediately returns its stale 401, leaving part of the dashboard fan-out failed even though authentication has recovered. After a retry returns 401, re-read the current token or rejoin the shared resolution gate before returning, with a bounded retry count to avoid loops.
Useful? React with 👍 / 👎.
Summary
a4fb2845ontodev2-go(GUI dashboard concurrent-401 token prompt gate).Go port
None — GUI-only (
gui/src/api.ts+ tests). No Go counterpart.Test plan