Skip to content

Add ADRs for cross-tab persistence reconciliation strategy#1836

Merged
kmcginnes merged 2 commits into
mainfrom
adr-cross-tab-reconciliation
Jun 16, 2026
Merged

Add ADRs for cross-tab persistence reconciliation strategy#1836
kmcginnes merged 2 commits into
mainfrom
adr-cross-tab-reconciliation

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Documentation only — records the two architectural decisions that gate the fix for the cross-tab clobber bug (#1820), before any code lands. No runtime changes.

Two ADRs under a new docs/adr/:

  • indexeddb-not-localstorage-for-persistence — persistence stays on IndexedDB (via localForage), not localStorage. Session and Schema payloads routinely exceed localStorage's ~5MB limit, a constraint invisible in the code that rules out the otherwise-obvious localStorage-based approaches.
  • per-key-diff-merge-cross-tab-reconciliation — concurrent-tab writes reconcile at the storage layer via a per-key, diff-the-output merge. Records the rejected alternatives (replay-the-updater, BroadcastChannel/storage-event live sync, Web Locks) and the explicit scope boundary: durability only — same-entry conflicts stay last-writer-wins and live cross-tab freshness is deferred.

Supporting: a core rule in AGENTS.md against hard-wrapping Markdown prose (the ADRs follow it).

Validation

pnpm checks passes (format/lint/types). No tests — documentation only. ADRs use the repo's date-prefixed naming convention (#1835) and reference each other by slug.

How to read: start with the IndexedDB ADR (the constraint), then the reconciliation ADR (the strategy built on it).

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Record the two architectural decisions governing the fix for #1820:
- IndexedDB (via localForage), not localStorage, for client-side
  persistence — Session and Schema payloads exceed localStorage's
  ~5MB limit, a constraint invisible in the code.
- Per-key diff-merge reconciliation at the storage layer, scoped to
  durability only; same-entry conflicts and live cross-tab freshness
  are explicitly deferred.

ADRs use the date-prefixed naming convention (#1835) and reference
each other by slug.
@kmcginnes kmcginnes marked this pull request as ready for review June 16, 2026 21:53
@kmcginnes kmcginnes merged commit 0003cb2 into main Jun 16, 2026
6 checks passed
@kmcginnes kmcginnes deleted the adr-cross-tab-reconciliation branch June 16, 2026 21:54
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.

ADR: cross-tab reconciliation strategy and IndexedDB persistence constraint

1 participant