WAI dev and the relay close a WebSocket cleanly; Quantum Studio opens its course from a link #538
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/relay-ws-close-drain-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#533's four commits, rebuilt on main after #537 (no force-push): #537 sends the two members certified on the Mac Studio to its runner, which #533's run had put on the new laptops.
Three changes, two of them behind one console error.
WAI Studio's "no console error" check failed in WebKit on macOS (CI runs WebKit only on Linux, which does not report it):
WebSocket connection to 'ws://127.0.0.1:…/moq' failed: Socket is not connected. Counting the console's errors after each step placed it at the pre-call test, which opens the relay's binding, waits for SETUP and closes (no error after leaving the room, one after the pre-call test). A browser sends its WebSocket Close right after its CLOSE_SESSION. That frame was still unread when the socket was shut, and a socket shut with the peer's bytes unread is reset, not closed.wai dev's tunnel (dx/dev.rs), which carries/moqfrom the origin to the relay, shut the client's socket both ways as soon as the relay ended its side. It now half-closes each side and reads the client's last bytes, for at most 2 s after the relay's end. A relay that does not end its side after the client has gone is shut after 5 s. This removes the error: the Studio e2e passes every check in WebKit, Chromium and Firefox on macOS (it failed two in WebKit before).dev::tests 10/10.joule-moq-relay's mux stopped reading a session's pipe as soon as the session closed, which is the same fault at the relay's own socket for a client that connects to it directly. It now reads on, discarding, until the peer ends the pipe or for at most 2 s. The crate's whole suite passes on Linux.
Quantum Studio:
#courseopens the circuits course and#course=<lesson>opens it at that lesson. A test opens/#course=bell, and both READMEs say so. The generatedllms.txtandllms-full.txtlist the quantum IDE, the interference course and WAI's home, so the site's sync no longer adds them. The CLI's guide tests (which hold the committed docs to the generator) pass.Two tests held to what they test (the first run's two red checks):
engine::setstest compared two runs of a set "less the wall clock" but kept each item's Merkle path. A path's sibling leaves digest the other items' results,elapsed_msincluded, so on a loaded runner the paths differed (sets.rs:556). It now strips the path too; verify() still checks the path against the root. 4/4, three runs.Clippy finds nothing in the changed code. Public-name check: clean.
🤖 Generated with Claude Code
When a session closed (the peer's WT_CLOSE_SESSION, or this end's), the mux's reader stopped reading at once; the writer then sent its Close and the socket went. A browser sends its WebSocket Close right after its CLOSE_SESSION, so that frame was still unread when the socket was shut, and a socket shut with unread bytes is reset rather than closed. WebKit reports the reset on the console ("WebSocket connection to ws://…/moq failed: Socket is not connected"), which failed WAI Studio's "no console error" check in WebKit on macOS after its pre-call test (which opens the relay's binding, waits for SETUP and closes). Counted per step: no error after leaving the room, one after the pre-call test. The reader now reads on after the close, discarding, until the peer ends the pipe or for at most 2 s, so the closing handshake finishes and the socket closes cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]>wai dev's origin tunnels /moq to the relay. When the relay ended its side, the tunnel shut the client's socket both ways at once (and the relay's when the client ended first). A browser's WebSocket Close, sent right after its CLOSE_SESSION, was then still unread, and a socket shut with the peer's bytes unread is reset, not closed. WebKit reports the reset ("WebSocket connection to ws://…/moq failed: Socket is not connected"): WAI Studio's "no console error" check failed in WebKit on macOS after its pre-call test (no error after leaving the room, one after the pre-call test). Each side's end now goes on as a half-close. After the relay's end the tunnel reads on (discarding what can no longer go to the relay) until the client ends its side, or for at most 2 s. A relay that does not end its side after the client has gone is shut after 5 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>