GeoLeaf Core API - v3.19.0
    Preparing search index...

    Interface GeoLeafCacheEvictedDetail

    Detail payload for geoleaf:cache:evicted — a cache made room for itself.

    🛑 THERE ARE TWO PRODUCERS, AND THAT IS DELIBERATE. The pattern recommended elsewhere — a single emission point guarded by a test, precedent editor-events.ts — is not reachable here: the two stores evict from different contexts, and no code can be shared between them.

    Producer Store What triggers it
    capabilities/offline/cache/cache-manager.ts (_enforceCacheQuota) IndexedDB end of a profile download, maxCacheBytes budget exceeded
    kernel/storage/sw-core.js → kernel/storage/sw-register.ts Cache API origin-quota pressure, or a write refused for quota

    The second goes through a postMessage: a Service Worker has no document, and it is copied verbatim into the deploy variants — it can import neither this contract nor the bus. sw-register.ts is the only place that re-establishes the signal on document.

    ⚠️ freedBytes is absent on the Cache API side, and that is not an oversight: the Cache API exposes no entry size. offline-ui already omits the size when missing — fabricating a number would be worse than staying silent.

    interface GeoLeafCacheEvictedDetail {
        evicted: number;
        freedBytes?: number;
        totalBefore?: number;
        totalAfter?: number;
        store?: "indexeddb" | "cache-api";
        reason?: "pressure" | "quota";
    }
    Index
    evicted: number

    Number of records ACTUALLY removed.

    freedBytes?: number

    Bytes reclaimed — known on the IndexedDB side only.

    totalBefore?: number

    Store size before eviction (bytes on IndexedDB, entry count on Cache API).

    totalAfter?: number

    Store size after eviction, same unit as totalBefore.

    store?: "indexeddb" | "cache-api"

    Which store evicted. Absent = IndexedDB, the historical shape.

    reason?: "pressure" | "quota"

    Why. pressure = the ORIGIN quota is close to saturation; quota = a write was refused. The worker's routine trim does not emit — it runs on every pan, and one toast per map move teaches users to stop reading them.