Skip to content

Documentation / @etherfold/browser / BROWSER_GENERATION_CAPS

Variable: BROWSER_GENERATION_CAPS ​

const BROWSER_GENERATION_CAPS: GenerationCaps

Defined in: packages/browser/src/storage/generation/OnIndexedDB.ts:285

What a BROWSER holds by default: the previous generation, and the new one.

Two, transiently, and not N. A browser keeps the previous generation only until the new one is promoted, which is exactly what story 1 needs (the app keeps rendering while the successor builds) and what makes the revert of story 4 available for as long as the reconfigure is fresh. A server or a CLI should be far more generous, because keeping generations to inspect, A/B-test and revert is the POINT there; that runtime sets its own, and this constant is not it.

It is a CONFIGURED number, and the one thing it must never be is derived from navigator.storage.estimate(): WebKit does not implement it, quota varies four-fold between engines and moves between runs on one engine, and with a real quota forced down to 8 MB it still reported 6.45 GB of headroom while writes were failing (work/notes/findings/browser-storage-headroom-for-generations.md). Nothing in this package consults it. The measured size is what makes two comfortable anyway: 31,332 real logs occupy roughly 2 MB stored, because IndexedDB compresses event payloads six- to ten-fold.