Repository navigation
fix(net): release AUTH enforcement's reactions on the session close - #6386
Conversation
Quest-Claim: a7a97ebd6265770e
`enforceGrant` raced the session's close with native `Promise.race` on every table or grant change, so each change left one reaction on the session-lifetime `closed` promise until the transport closed: 1,000 changes left 1,001. An authorization wait also ignored the close. Race with `@moq/signals` `race`, which drops its listener once decided, and end an authorization wait through one AbortController the close aborts. The same repeated race over a lifetime promise is fixed in the lite publisher's drain loop and the IETF legacy announce wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
|
Outcome: the quest is complete and its file is deleted. AUTH enforcement now keeps O(1) reactions on the session close however much the table churns. It has no open decisions, so this is ready for review. In (Written by Claude Opus 5.5) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
No actionable comments were generated in the recent review. ℹ️ Recent review info
WalkthroughAUTH enforcement now passes a connection-close abort signal to Priority: Merge Risk:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 730c98f7ac
ℹ️ 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".
Ending enforcement because the session closed during an authorization wait returned without disposing the table and grant callbacks it had registered for that pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…t/auth-listeners # Conflicts: # quest/m1/release-audit/README.md
|
Merged (Written by Claude Opus 5.5) |
# Conflicts: # quest/m1/release-audit/README.md
# Conflicts: # quest/m1/release-audit/README.md
Problem
enforceGrant(js/net/src/auth_session.ts), which closes a publishing browser session that advertises outside its in-band AUTH grant, raced the session'sclosedpromise with nativePromise.raceon every broadcast-table or grant change. A native race cannot drop its reaction on the loser, so each change left one reaction on a promise that lives as long as the session. A new test counts 1,001 reactions after 1,000 changes. Its authorization wait (auth.ready) also ignored the close. Completes Release AUTH terminal listeners.Approach
racefrom@moq/signals, the repository's listener-releasing race, so one reaction onclosedserves every wake.AbortControllerthat the close aborts once.readyremoves its abort listener after each wait, so this adds no reaction per wait, which passinguntil: () => closedwould.lite/publisher.ts: the drain loop raced the subscription'sendedonce per batch of drops.ietf/subscriber.ts: each legacy zero-prefix announce wait chained a fresh.catchonto the session'sclosed, which stayed attached after the consumer ended.connect.ts, whose races are over promises created per connect attempt.Impact
Public API and wire: none.
Validation
New
auth_session.test.ts, which counts the reactions each promise receives viaPromise.prototype.then:mainleaves 1,001 onclosed.Suites:
bun testinjs/net: 2,636 pass, and repeated full runs pass.just check: two failures in tests this PR does not touch:@moq/hang's libav test-order failure, already onmainand fixed in moq-dev/moq#6382.moqt-22 > a request waits for its token and survives union renewal, which failed once under the full parallel check. It passed 5 isolated runs and 3 fulljs/netruns, here and onmain. This looks like a load-dependent flake.🤖 Generated with Claude Code
https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
(Written by Claude Opus 5.5)