You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
One-time phone client: WebCrypto and the socket's open have no deadline #914
Code:#handshake and #race in lib/src/remote/client/one-time-client.ts.
Failure path:connectOnce computes the room's hard deadline (expiry * 1000 + ONE_TIME_EXPIRY_GRACE_MS), but only #core.exchange and #core.exchangeControl enforce it. The steps before them, generateNoiseKeyPair, createNoiseInitiator, writeMessage and #openRendezvous, go through #race, which a failure or close() can interrupt but no timer can. A WebCrypto call that never settles, or a WebSocket that stays CONNECTING, leaves the page on its code screen with no ending. It ends only when the browser gives up on the socket or the person taps Cancel. one-time.md's failure table promises ONE_TIME_LINK_EXPIRED_MESSAGE for "no answer by the room's deadline".
Suggested fix: in connectOnce, arm one timer at the room's hard deadline that calls #fail(ONE_TIME_LINK_EXPIRED_MESSAGE), and clear it at the switch or in #teardown. #race then covers the WebCrypto and socket-open waits as well. To test it, stub createWebSocket with a socket that never opens, advance the clock past the deadline, and assert the expired copy.
Found while trimming #904, which had parked this as a spec "Known gap".
#916 arms one timer at the room's hard deadline in connectOnce that fails the attempt with ONE_TIME_LINK_EXPIRED_MESSAGE. It is cleared once an ok outcome is read, where the direct deadline takes over, and in #teardown. The regression test is the one you suggested: a socket that never opens, with the clock advanced past the deadline. It hung before the change and passes now, and CI is green. The PR also adds the rule to one-time.md's phone-client section.
Activity
dormouse-bot commentedon Oct 2, 2026
#916 arms one timer at the room's hard deadline in
connectOncethat fails the attempt withONE_TIME_LINK_EXPIRED_MESSAGE. It is cleared once anokoutcome is read, where the direct deadline takes over, and in#teardown. The regression test is the one you suggested: a socket that never opens, with the clock advanced past the deadline. It hung before the change and passes now, and CI is green. The PR also adds the rule to one-time.md's phone-client section.