Add guarded API token refresh handling#9
Conversation
|
Thanks for the submission and the detailed validation notes. I am not going to merge this yet because the required repository-wide
A couple of specific things I will check before merging:
Please push a follow-up with a clean full-build diagnostic bundle when ready. |
|
Thanks for the review. I pushed a follow-up that makes the required repository-wide diagnostic build green. Changes in the follow-up:
Validation now recorded:
New diagnostic artifacts committed for source commit
The latest PR head is |
|
Thanks for pushing the follow-up. I can see the latest diagnostic bundle now records the required repository-wide I am still not going to merge this head as-is, mainly because the final PR has grown beyond the
For the token-refresh part itself, the shape is reasonable: single-flight refresh, one retry after a successful refresh, no recursion for
If the Haskell shim and |
|
Thanks for the cleanup. Removing the stale failed diagnostic bundle helps, but I still cannot merge this PR in its current shape. The remaining diff is still larger than the guarded API token refresh bounty:
Those may be useful build/diagnostic fixes, but they are separate from the frontend token refresh behavior and need separate review. For this bounty PR, please narrow the branch to the token refresh implementation, its executable validation fixture/script, and the final green diagnostic bundle for that focused source commit. I am leaving this open for now, but I will not merge while unrelated build/tooling changes remain in the same PR. |
5a2f80c to
62362c3
Compare
|
Thanks again. I force-pushed the branch to the clean 3-commit history ending at This supersedes my earlier repository-wide diagnostic-support attempt. The current PR no longer contains the Haskell/OpenAPI shim files, Current scope is now limited to:
Validation rerun on the clean branch:
|
Summary
Fixes #2.
Adds guarded token refresh handling to
frontend/src/services/api.tsso concurrent 401/403 responses share one refresh operation, successful refresh retries the original request once, and failed refresh clears local auth state with a typed authentication error.Changes
/auth/refresh./auth/refreshitself returns 401/403.frontend/src/services/api_refresh.validation.tsandnpm run test:api-refresh.build.pyf-string syntax error that prevented the diagnostic script from parsing/running.600e1d20:diagnostic/build-600e1d20.logddiagnostic/build-600e1d20.jsonTesting
cd frontend && npm installpassed with 0 vulnerabilities.cd frontend && npm run test:api-refreshpassed.cd frontend && npm run buildpassed.git diff --check origin/main...HEADpassed.python3 -m py_compile build.pypassed.python3 build.py -m frontendgenerated the focused diagnostic bundle with 1/1 frontend module passing and 0 failures.gitleaks git --log-opts="origin/main..HEAD"reported no leaks for the PR range.Scope note
The Haskell/OpenAPI shim files,
frailboxportability changes, stale failed diagnostic bundle, and repository-wide diagnostic support commits were removed from this PR history. The only remainingbuild.pychange is the one-line syntax fix needed for the diagnostic script to run.Checklist