0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/crates/rpc/tests
Wing 68c7ea286c
Chats reach long chats on other devices (#1307)
A long transcript was one RPC message across the device relay. Past 16 MiB
the Durable Object's single frame hit tungstenite's default frame cap in the
reader, ending the whole peer link; past 32 MiB workerd closed the host's
socket, ending every client's. Each read of such a chat from another device
failed with "WatchDocMessages: stream ended before the transcript arrived",
and send_message read the transcript before delivering, so sends failed too.

- Relay: clients that reassemble say so in the RPC stream id; hosts send them
  large replies in 512 KiB pieces. Older clients get an error for that request
  instead of a frame that ends their link. Relay dials take frames up to the
  local socket's cap, so older hosts' big frames arrive.
- WatchDocMessages takes a window (limit, offset, after): frames carry only
  the slice and its facts. Older hosts ignore it and the reader slices.
- send_message delivers first. The turn's marker is the sent message's own id,
  so nothing about the transcript can hold up or undo a send. It no longer
  needs the host's harness catalog when the chat has a harness.
- read_chat, get_chat, respond_to_input and waits ask for windows, and waits
  follow deltas rather than re-reading.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-11-09 06:28:32 -07:00
..
device_room.rs Chats reach long chats on other devices (#1307) 2026-11-09 06:28:32 -07:00