Ask the daemon for a window instead of caching the transcript

The cache existed to make a reload cheap, and it could not: a 4800-record transcript is ~10 MB against a 5 MB sessionStorage quota, so the biggest sessions it was written for were the ones it failed on. It is gone, along with the remembered cursor and the diagnostics snapshot that were only there to avoid replaying records it held, and the client now asks for what it can hold: `subscribe` with `after_seq: null` and a `limit` is a window request, and the daemon answers with the newest window of at most that many records, anchored at its own last compaction, reporting its range and its floor in `sync_started` and `sync_completed`. `{ type: "history", before_seq, limit }` asks for the records behind a loaded window; the answer is the same replay shape, its records prepend into the timeline where their sequence puts them, and the live cursor does not move for them. Deduplication is a set of seen sequences instead of a scan of the transcript per record, which is what makes a retried or overlapping page idempotent. A daemon that says nothing about its floor offers no paging, so a client against today's daemon degrades to what it does now rather than to a button that does nothing. The fixture serves the same contract, with a compaction every forty turns of the bulk session, so the behaviour is reachable in a browser: at 400 turns the console opens on 481 records instead of 4809.

3d843004 parent 6d202ae3 +425 −458
browse files