Store offline issue screenshots outside localStorage quota #473

Closed
opened 2026-08-10 10:10:10 +00:00 by timmy · 0 comments
Owner

Problem

Screenshot-backed offline issue capture serializes base64 bytes into localStorage before mirroring to IndexedDB. Two 2 MiB screenshots produce about 5.6 MiB of synchronous localStorage data, so the second capture can fail with QuotaExceededError before durable admission.

User impact

Mobile operators must be able to queue multiple screenshot-backed issues offline without UI-thread multi-megabyte localStorage writes or quota failure.

Acceptance criteria

  • Durable screenshot admission writes the complete capture to IndexedDB before confirming it.
  • localStorage keeps only bounded attachment metadata/reference state and no screenshot payload.
  • A 5 MiB localStorage quota admits two 2 MiB screenshots when IndexedDB succeeds.
  • IndexedDB admission failure does not create a phantom local outbox item.
  • Foreground/background delivery still receives attachment bytes and preserves retry-safe staged upload behavior.
  • Existing base64-backed records migrate without losing delivery capability.
  • Focused tests and the full suite pass.

Evidence / duplicate check

Current frontend/issue-outbox.js writes attachment.data through write() before backgroundSync.reconcile(). Audit of all historical issue/PR titles and recent commits found screenshot capture/upload/idempotency work (#467/#469/#471), but no attachment quota, blob-store, IndexedDB-first, or localStorage pressure work.

## Problem Screenshot-backed offline issue capture serializes base64 bytes into `localStorage` before mirroring to IndexedDB. Two 2 MiB screenshots produce about 5.6 MiB of synchronous localStorage data, so the second capture can fail with `QuotaExceededError` before durable admission. ## User impact Mobile operators must be able to queue multiple screenshot-backed issues offline without UI-thread multi-megabyte localStorage writes or quota failure. ## Acceptance criteria - Durable screenshot admission writes the complete capture to IndexedDB before confirming it. - localStorage keeps only bounded attachment metadata/reference state and no screenshot payload. - A 5 MiB localStorage quota admits two 2 MiB screenshots when IndexedDB succeeds. - IndexedDB admission failure does not create a phantom local outbox item. - Foreground/background delivery still receives attachment bytes and preserves retry-safe staged upload behavior. - Existing base64-backed records migrate without losing delivery capability. - Focused tests and the full suite pass. ## Evidence / duplicate check Current `frontend/issue-outbox.js` writes `attachment.data` through `write()` before `backgroundSync.reconcile()`. Audit of all historical issue/PR titles and recent commits found screenshot capture/upload/idempotency work (#467/#469/#471), but no attachment quota, blob-store, IndexedDB-first, or localStorage pressure work.
timmy closed this issue 2026-08-10 10:17:55 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#473
No description provided.