Skip to content

Add browser storage quota, persistence and durability diagnostics #1156

Closed

Description

@d-oit

Problem

The application is local-first and stores the canonical corpus in IndexedDB, with additional data in Cache Storage and attachment stores. Browser-managed origin storage is generally best-effort and may be evicted under storage pressure. The current storage reporting covers the embedding-model cache, but does not give users a complete view of origin quota or persistent-storage status.

Scope

Extend Settings → Storage with a reliable, privacy-preserving storage health panel.

Requirements

  • Use navigator.storage.estimate() when available and display estimated origin usage and quota.
  • Use navigator.storage.persisted() to report whether persistent storage has been granted.
  • Provide an explicit user action to request persistence through navigator.storage.persist(); explain that the browser may decline.
  • Show graceful unsupported/unavailable states for browsers that do not implement the APIs or reject calls.
  • Distinguish measured values from estimates. Do not imply that Cache Storage content-length sums represent exact disk usage.
  • Include known application-owned stores where safely measurable: canonical corpus, attachments, semantic cache/model cache and recovery data. Avoid expensive full scans on every settings render.
  • Surface last successful backup time/status if this is already available from backup metadata; otherwise link to backup settings without inventing a timestamp.
  • Warn when the origin is approaching its reported quota, using a documented threshold and conservative copy.
  • Keep diagnostics local; do not transmit storage metrics.

Acceptance criteria

  • Storage panel reports usage/quota when supported.
  • Persistent-storage status and request action work in Chromium and gracefully degrade elsewhere.
  • API failures never crash Settings.
  • Tests cover unsupported APIs, rejected promises, null estimates and browser denial.
  • E2E verifies the request action and status rendering.
  • UI clearly explains that persistence is not a backup and cannot prevent manual site-data deletion or device loss.
  • Existing model-cache clearing behavior remains unchanged.

References

Activity

  1. d-oit commented on Nov 19, 2026

    @d-oit
    OwnerAuthor

    Implemented in #1178 (90246d1).

    • reportStorageHealth() + storage-report slice compute quota/persistence/durability diagnostics (storage estimate, IndexedDB envelope health, recovery metadata) with the shared dks-core storage contracts (packages/dks-core/src/io.ts port contract unchanged by review).
    • Settings view exposes the health panel; e2e coverage in e2e/storage-health.spec.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions