Skip to content

Unify browser storage quota handling - #75

Merged
astrovm merged 1 commit into
mainfrom
codex/unify-storage-quota-handling
Jul 31, 2026
Merged

Unify browser storage quota handling#75
astrovm merged 1 commit into
mainfrom
codex/unify-storage-quota-handling

Conversation

@astrovm

@astrovm astrovm commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What changed

  • Added one shared browser-storage policy for best-effort persistence, informational estimates, quota detection, and consistent error messages.
  • Removed predictive navigator.storage.estimate() gates from bundled offline games and Internet Games installs.
  • Migrated Pink Panther and reVCDOS persistence/error handling to the shared policy.
  • Added rollback cleanup for partial Cache Storage writes, failed Pink Panther ISO activation, reVCDOS packed-manifest failures, and optional Internet Game artwork metadata.
  • Made lazy legacy-game asset caching best-effort when the actual browser quota is full.
  • Fingerprinted the shared policy in production builds and rewrote all iframe references to the hashed asset.

Why

Brave deliberately generalizes StorageManager.estimate() and browser estimates are not exact capacity guarantees. Treating them as preflight authorization caused valid downloads to be rejected before the browser attempted a real write.

Impact

Downloads now proceed until the underlying Cache Storage, IndexedDB, or OPFS operation actually refuses the write. Real QuotaExceededError failures are reported consistently, and partial data is cleaned up. Storage estimates remain available for informational UI only.

Validation

  • bun run test — 119 passing, 998 assertions
  • bun run quality
  • bun run build --revision HEAD
  • Production artifact validation, including hashed storage-policy references in the shell and all three iframe entrypoints
  • Live browser smoke test on a fresh local origin: 42-game Offline settings rendered with no console errors
  • Regression coverage for low/fixed estimates, rejected persistence requests, actual quota failures, rollback cleanup, and best-effort lazy caching

@astrovm
astrovm marked this pull request as ready for review July 31, 2026 05:27
@astrovm
astrovm merged commit a2e2260 into main Jul 31, 2026
6 checks passed
@astrovm
astrovm deleted the codex/unify-storage-quota-handling branch July 31, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant