fn for_a_client(update: SessionUpdate, cap: usize) -> SessionUpdateExpand description
The update as it crosses to a client.
A seat’s transcript never rides an update to a client. The two
variants that carry one are the session task’s seed for the transport’s
own copy, and a client answers them with a READ - the subscribe snapshot’s
windowed conversation and more above it (the client’s own REPLACES
list says so, client/src/session/apply.ts) - rather than drawing what
they carry. So the message list is emptied here, at the one place an
update becomes something a client hears; what stays is the seat’s session
facts.
The bound has to be the frame’s, not the window’s. A window is bounded
by the ceilings a seat keeps it in (frames and bytes, the module beside
the task), and those are a seat’s own business: what a live 2.5GiB seat’s
resume did to a connection (#2150) was ride one Connected as a single
2.46GiB frame, refused at the 256MiB one the client’s socket carries
(MAX_FRAME_BYTES, client/src-tauri/socket.rs). What a client reads
instead is a page, and a page is bounded by turns on top of whatever the
window holds (twenty a subscribe, twenty a more), so its size leans on
that frame cap rather than sitting orders under it. A frame whose size
does not depend on the conversation’s size is the only one that holds
whatever the seat weighs.