The reviewer's two findings on the text of when a summary is sent
Jonas Templestein, 2026-11-27 00:04 UTC · e8088d53d188f49e1cdfaa011fa52d879de48a6e · parent b5bee93
2 files changed
M core/itx/src/context/awake.ts
@@ -13,13 +13,20 @@ // - One Durable Object accepts 32,768 sockets. A dial refused past that is logged, and that // context is missing from the list: nothing else depends on the socket. // -// The same socket carries what a context says about itself (context-summary.ts). While it works: -// when its activity stack changed or it said what it is, at most once per -// `AWAKE_ACTIVITY_DEBOUNCE_MS`; with no such change, once per `AWAKE_SUMMARY_EVERY_MS`. And once -// before it closes. A summary equal to the last one sent is not sent. The accepting context keeps -// the newest of each in one SQLite row (context-catalog.ts), written when the summary differs -// from the row: at least one row written per wake of a context, and for a context whose log -// grows fast up to ten a second, beside the rows that the wake writes in its own log. +// The same socket carries what a context says about itself (context-summary.ts). A context that +// works sends its summary at three times: +// - `AWAKE_ACTIVITY_DEBOUNCE_MS` after its activity stack changed or it said what it is. That +// wait gathers a burst of such changes into one summary. It is no least time between two +// summaries; +// - at a recheck, each `AWAKE_QUIET_MS` while it is busy, when its activity stack changed since +// the last summary or the last summary is `AWAKE_SUMMARY_EVERY_MS` old; +// - before it closes. +// A summary whose text equals the last one sent is not sent, so a wake can send none. A context +// with much activity sends about ten summaries a second. The accepting context keeps the durable +// part of each summary that comes in one SQLite row (context-catalog.ts `store`). It writes that +// row at each summary of an equal or later offset and does not compare the two: a summary that +// differs in its activities alone writes the same row again. These rows are beside the rows +// that the wake writes in the context's own log. // // THE CATALOG ANSWERS EACH SUMMARY, on the same socket: it kept it, or it refused it. A context // that goes quiet keeps its socket until its last summary is answered, at most
M core/lib/src/api.ts
@@ -1873,11 +1873,12 @@ /** ONE CONTEXT AS A WATCH SENDS IT: its listing without `awake` and `activities` (the awake list * is a watch of its own, `{ awake: true }`), the two values that the orders sort by, and the - * catalog's revision at which the row last changed. A ROW CHANGES WHEN ITS CONTEXT'S SUMMARY - * DOES, in something that the row holds: the counts and times of its events, its storage, what - * it says of itself. A context that works sends a changed summary at most once in 100 ms, and - * its last one when it goes quiet. So the row of a context whose log grows fast changes up to - * ten times a second: a watcher that draws should not draw at each frame. */ + * catalog's revision at which the row last changed. A ROW CHANGES WHEN ITS CONTEXT SENDS A + * SUMMARY THAT DIFFERS in something the row holds: the counts and times of its events, its + * storage, what it says of itself. A context that works sends a summary shortly after each + * burst of its activity, and one when it goes quiet. It gathers a burst for 100 ms, and that is + * no least time between two summaries. So the row of a context whose log grows fast changes + * about ten times a second: a watcher that draws should not draw at each frame. */ export type CatalogRow = Omit<ContextListing, "awake" | "activities"> & { /** What the order `active` sorts by, in milliseconds: when the context was last active * (`lastActivityAt`, or `lastEventAt` when it has had no activity of its own). */