Repository navigation
Description
What
The Worker's Durable Object is put away whenever it is idle (about ten seconds, by Cloudflare's lifecycle; 11 to 14 in the local runtime) and another starts with nothing in memory. #13570 was built as if that were rare, and in service it saved nothing; #14000 moves what it kept into storage and has the real-runtime check put the object away.
Going through the object's other fields for the same assumption found these. Each is in memory only, and each is written as if the object lasted. None of them is a wrong answer shown to anyone; they are things asked for more often than meant, numbers that mean less than they look, or a wait with no end.
| # | What | Where | In service |
|---|---|---|---|
| 1 | The ten-minute gate on asking GitHub for the released Android build (released) |
edge/src/edge.ts, androidRelease |
Every object that starts asks again on its first health read or Android page: a request to github.com each time, and up to eight seconds of deadline. The comment says "GitHub is not asked on every request". |
| 2 | The queue store is asked with no deadline | src/ops.ts, pipeline |
A queue store that never answers holds the read, and the object in memory, for as long as the platform lets it. Every other outgoing request has a deadline. |
| 3 | Health's answered and deferred (sure, unsure) |
edge/src/edge.ts |
Counted since the object answering started, which is seconds ago: the numbers look like totals and are not. (github.answers was the same until #14000.) |
| 4 | "Someone is looking" (lastDocAt, 90 s) |
edge/src/edge.ts |
The laptop is told to refresh faster while the app is open. An object that starts for the laptop's report has seen no document read, so it says nobody is looking unless a read came within the last few seconds. To be checked against how often the app reads: if it reads more often than the object is put away, this holds. |
| 5 | The gate on asking the host for its key (lastKeyFetch, 30 s) |
edge/src/edge.ts |
Reset with each object, so the gate is as long as an object lasts. |
| 6 | The limiters on refused reports and on phone linking (syncRefused, phones.link, phones.refused) |
edge/src/edge.ts |
Reset with each object. A flood keeps the object in memory, so they hold while it lasts; said here so that it is a decision and not an accident. |
| 7 | A section kept in pieces (putMirror) |
edge/src/edge.ts |
The pieces are not marked as one section's. A write stopped between pieces and the index is caught only because the mixture does not parse. #14000's memory marks each piece; the same would close this. |
| 8 | The key sets' cache (jwksCache) |
src/auth.ts |
Module memory: each start asks the issuer again. Public keys, one request; noted for completeness. |
Also measured while doing #14000, in the edge's tests: one hour of the object's own clock with nothing changing writes to storage 74 times. 60 are the count of GitHub's answers (one write an answer) and 12 are sections stored again though nothing changed. If the plan's daily allowance of writes ever matters, those are the two to thin.
Done when
- 1 and 2 are fixed (the gate stored with what it gates; the queue store call under
timed), each with a test that starts a new object or lets the deadline run out. - 3 is either counted across objects or named for what it is.
- 4 is measured on the live Worker (how often
wokechanges while the app is open) and fixed if the laptop is being told nobody is looking. - 5 to 8 are each decided: stored, or left with a line saying why memory is enough.
- How long an object lasts in service is read from
wokeon the live Worker and written intoedge/README.mdbeside the local runtime's figure.
Why now
The same assumption cost a day of believing a saving that was not there. The rule that came out of it is in edge/README.md ("The object is put away whenever it is idle"); this is the rest of the object held to it.
Generated by Claude Code
Activity
developing-today commentedon Nov 24, 2026
CODE-5149
fix(pm-console): hold what is read back from storage to what could ha…
dezren39 commentedon Nov 24, 2026
One more for the list, from the first minutes after #14000 deployed: over three minutes the live Worker asked GitHub nothing. Either no device takes notifications, or the object's own clock (which reads the prompts each minute while one does) is not running. Health does not say which. It should say whether the clock is wanted and when it last read, so that the path notifications depend on can be seen from outside.
Generated by Claude Code
fix(pm-console): a time further off than could have been set is not b…
dezren39 commentedon Nov 24, 2026
Done in #14022 (merged 02:42Z, in service as
fc438864af51):woke), which is whatansweredanddeferredare counted from.clock.wantedandclock.next.Read from the live Worker:
clock.wantedisfalse: no device takes notifications from the edge at the moment, so its own clock is not running and nothing would be pushed. The object's next wake (02:55Z when read) is the check for a machine gone quiet.Left: 4 (whether the laptop is told nobody is looking), 5, 6, 7, 8, and the two writers to thin (the count of GitHub's answers, and sections stored again unchanged).
Generated by Claude Code