Repository navigation
fix(client): spread clearance renewal across tabs; recovery succeeds when the gate passes - #89
Merged
Merged
Conversation
…when the gate passes Tabs share one clearance cookie, so they all reached the same renewal instant and could each mint. Each page now draws a renewal lead time between the margin and 1.5x the margin, so the first tab's cookie is usually in place before the next one checks. createClearanceFetch reported recovery-failed when a cleared retry got a non-2xx answer from the origin. Success now means the retry was not challenged again; the origin status stays in enforcement-outcome.
Merged
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.
Two clearance fixes found in live multi-tab and production testing.
Renewal spread. All tabs share one cookie and computed the same renewal time (expiry minus 120 s), so two open tabs could each mint at the same moment. Each page now picks, once, a lead time between the margin and 1.5× the margin.
renewalTime()is now the single place the renewal time is computed; it was duplicated in two places before.Math.randomto 0, so the existing timings stay exact.Recovery outcome.
createClearanceFetchreportedrecovery-failedwhen the cleared retry reached the origin and the origin answered 404. Success now means the retry was not challenged again. The origin status stays inenforcement-outcome. The README is updated, plus two new tests (origin 404 → succeeded; challenged again → failed).This changes the documented event meaning, so it ships as 0.24.0.
Build, lint and workspace tests pass locally (client: 59 tests).