Skip to content

Publish a revisioned cache inventory to timeline and playback #188

Description

@danielway

Problem

The timeline is an unversioned asynchronous snapshot of scan_index. Eviction deletes backing blobs without refreshing that snapshot, site changes do not clear or generation-gate an in-flight cache result, and playback/render lookup caches often invalidate by scan count rather than manifest contents.

A stale load can republish old-site data; adding a sweep/product to an existing scan can update timeline cells while macro frames remain stale; eviction can leave a solid cached cell whose blob no longer exists.

Relevant code: src/app/worker_results.rs:70-99, src/app/command_dispatch.rs:593-635, src/app/frame_setup.rs:107-139, and src/core/domain/playback.rs:226-351.

Scope

  • Introduce a monotonic cache inventory revision/generation published only after committed ingest, replacement, delete, eviction, clear, or repair.
  • Attach site, request generation, and inventory revision to timeline loads.
  • Reject stale site/generation results and prevent older snapshots from rolling back acknowledged mutations.
  • Make all cache mutations emit explicit invalidation/publication effects.
  • Rebuild macro frames, previous-sweep lookup, availability views, and request-ledger projections from inventory revision rather than scan count.
  • Define how a selected/displayed item reacts when its backing revision is evicted or replaced.

Acceptance criteria

  • Successful eviction or clear removes affected cached cells without waiting for unrelated activity.
  • An old-site or older-generation load cannot replace the active timeline.
  • Adding a product or elevation to an existing scan invalidates playback frame lists and previous-sweep lookup.
  • Concurrent refresh and mutation converge on the newest committed inventory.
  • A missing blob contradicting the manifest triggers reconciliation rather than leaving a permanently stale cached cell.
  • Cache-size statistics and timeline metadata are associated with a coherent revision or explicitly tolerate/document skew.
  • Pure reducer tests cover stale outcomes and invalidation; IndexedDB orchestration tests cover refresh-versus-ingest/eviction races.

Parent: #185. Depends on the canonical mutation/revision foundation from the IDB issue. Related symptom: #145 and closed PR #177.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions