Move offline work details from localStorage to IndexedDB #525

Closed
opened 2026-08-11 00:19:20 +00:00 by timmy · 0 comments
Owner

Problem

Offline Today stores every minimized issue, update, and pull-review detail—including bounded diffs—in one synchronous localStorage value (frontend/offline-work.js). Five maximum-bounded reviews can exceed common 5 MiB localStorage quotas, so warming can finish its network work but fail durable admission. Whole-cache JSON parsing and rewrites also block the mobile UI thread.

This is not duplicate work: #473 moved screenshot bytes for the issue outbox to IndexedDB; #345/#355 introduced offline work details and diffs but still use stackchain.offline-work.details.v1 in localStorage. No historical issue or current commit migrates this store.

User flow

An operator enables offline Today, warms assigned issue/update/review details (including large diffs), closes or restarts the mobile PWA, and can reopen those details without localStorage quota failure. Clearing private data or signing out removes the durable records.

Acceptance criteria

  • Persist account-bound offline snapshot/detail records as individual IndexedDB records; retain only the opt-in setting in localStorage.
  • Report save/readiness only after the IndexedDB transaction commits; failed durable admission must not create a false ready state.
  • Migrate existing v1 localStorage snapshot/details once, deleting legacy payloads only after successful commit.
  • Preserve expiry, allowlisting, ten-detail eviction, SHA-scoped review data, and prior-copy-on-refresh-failure behavior.
  • Clear, opt-out, sign-out, revocation, and expiry purge the IndexedDB database.
  • Behavioral tests prove operation with a 5 MiB localStorage ceiling and persistence across module recreation; focused and full suites pass.
## Problem Offline Today stores every minimized issue, update, and pull-review detail—including bounded diffs—in one synchronous `localStorage` value (`frontend/offline-work.js`). Five maximum-bounded reviews can exceed common 5 MiB localStorage quotas, so warming can finish its network work but fail durable admission. Whole-cache JSON parsing and rewrites also block the mobile UI thread. This is not duplicate work: #473 moved screenshot bytes for the issue outbox to IndexedDB; #345/#355 introduced offline work details and diffs but still use `stackchain.offline-work.details.v1` in localStorage. No historical issue or current commit migrates this store. ## User flow An operator enables offline Today, warms assigned issue/update/review details (including large diffs), closes or restarts the mobile PWA, and can reopen those details without localStorage quota failure. Clearing private data or signing out removes the durable records. ## Acceptance criteria - Persist account-bound offline snapshot/detail records as individual IndexedDB records; retain only the opt-in setting in localStorage. - Report save/readiness only after the IndexedDB transaction commits; failed durable admission must not create a false ready state. - Migrate existing v1 localStorage snapshot/details once, deleting legacy payloads only after successful commit. - Preserve expiry, allowlisting, ten-detail eviction, SHA-scoped review data, and prior-copy-on-refresh-failure behavior. - Clear, opt-out, sign-out, revocation, and expiry purge the IndexedDB database. - Behavioral tests prove operation with a 5 MiB localStorage ceiling and persistence across module recreation; focused and full suites pass.
timmy self-assigned this 2026-08-11 00:19:20 +00:00
timmy closed this issue 2026-08-11 00:36:27 +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#525
No description provided.