Repository navigation
web-js: retire auth sessions when their owning call is let go - #2501
Merged
Merged
Conversation
Match the runner's let-go rules (LLP 1069.006 D3/D4/D7) in host/web-js/auth.js: an openAuthSession hold or popup is owned by the mutation or resource call that started it and is retired whenever that call is superseded, reset, refused, or unmounted, even when the replacement completes synchronously or never opens another auth session. - Export a LetGo hook from rt.js (invoked after standing commit effects, rollback, and unrun deferred tails) and register auth.prune(). - Track the owning call and owner identity from ts-data.js / rust-data.js across await and plain .then continuations, superseding by owner identity when present so distinct instanced mutations still get 409. - On drop or let-go, remove the entry from Live, close the live popup and timers immediately via authHost.cancel(ticket), close any unadopted prepared window, release the ordinary-request wait, and close the abandoned ticket's inflight accounting without settling the old promise. - Guard already-let-go calls before holding, opening, or superseding a live session. - Add unit, runtime, and Chromium regression tests covering popup cancel, agent hold retirement, inflight accounting, refusal rollback, resource let-go, and late callback rejection.
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.
Closes the
QUEUE.mditem for web JS auth hold let-go / supersession (host/web-js/auth.js).Summary
openAuthSessionentries inhost/web-js/auth.jsto their owning mutation or resource call (call.ownerand runtime ticket) and registerauth.prune()on a newLetGohook inhost/web-js/rt.js(fired after standing commit effects, rollback, and unrun deferred tails).authHost.cancel(ticket)inhost/web/auth-glue.jswhenever the owning call is superseded, reset, refused, or unmounted — even when the replacement completes synchronously or never callsopenAuthSession.retireCall) without settling the abandoned promise (LLP 1069.006 D3/D4), guard already-let-go continuations, and supersede by owner identity when available so distinct instanced mutations still receive409.host/web-js/auth-let-go.test.mjs), and Chromium (host/web/auth-fixture.test.mjs) regression tests, and remove the resolvedQUEUE.mdline.Verification
bun test --isolateacross 17 auth/web-js test suites (includingauth-let-go.test.mjsand Chromiumauth-fixture.test.mjs): 136 pass, 0 fail (1 skip: missing WebKit).bun test host/web/tests/js-runtime.test.mjs --timeout 20000: 68 pass, 0 fail.cargo test -p exact-runner auth::: 15 pass, 0 fail.bun scripts/gate.mjs: PASS.