Files
dsh-context/tests/host
bowenliang123 5f20076f3e fix(host): yield during the cold detail fold and cache payloads by durable revision (issue #145)
A cold /detail request folded the whole log synchronously inside the request
(~0.35s per 30k events on a fast host) and re-folded on every view. The fold
now yields to the event loop every 1,000 events (the result is asserted
byte-identical against a buildTimelineDetail reference), and the folded
payload is cached keyed on the observation's (persistence instance, session
id, durable revision) tuple — the same trust tuple dsh's own observation
reader uses — so an unchanged cold session re-serves in ~1ms while a changed
log, a swapped backend, an observation without a revision (a live-race cut),
or a config remount always refolds. The cache is bounded at four payloads
(each bounded by the fold bounds) and lives in the watch closure.

The observation lease now disposes on every path including the early returns
(a latent pin on hostile faces is gone with the restructure).
2026-10-14 02:46:02 +08:00
..