fix: end the one-time phone's pre-outcome waits at the room's deadline - #916
Merged
Merged
Conversation
dormouse-bot
requested a deployment
to
hosted-preview
October 2, 2026 14:07 — with
GitHub Actions
Waiting
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.
OneTimeClient.connectOncecomputed the room's hard deadline (expiry * 1000 + ONE_TIME_EXPIRY_GRACE_MS) but only handed it to the session core'sexchangeandexchangeControl. The waits before those —generateNoiseKeyPair,createNoiseInitiator,writeMessage, and the rendezvous socket's open — run through#race, which a failure orclose()could interrupt but no timer could. A socket that stayedCONNECTINGtherefore left the page on its code screen indefinitely, instead of showingONE_TIME_LINK_EXPIRED_MESSAGEasdocs/specs/one-time.md's failure table promises.connectOncenow arms one timer at the hard deadline that calls#fail(ONE_TIME_LINK_EXPIRED_MESSAGE), which wakes#raceand the core's waiters alike. It is cleared once anokoutcome is read (from thereDIRECT_ONLY_DEADLINE_MSbounds the direct-path wait, so the "between anokoutcome and the switch" copy is unchanged) and in#teardown, soclose()still leaves nothing armed.The new case in
one-time-client.test.tsopens a socket that never opens, advances the test clock to the hard deadline, and expects the expired copy, a normally closed socket, and no armed timers. Before the change it hung until the 5 s test timeout; it passes now, along with the rest ofone-time-client.test.tsandone-time-e2e.test.ts. The phone-client section ofone-time.mdgains the rule, and its word budget is ratcheted for it.Closes #914 — automated triage