super-productivity/docs/plans
Johannes Millan 05f6bd27d1
fix(op-log): serialize SQLite adapter transactions on the shared connection (#8849)
* fix(op-log): serialize SQLite adapter transactions on shared connection

The SQLite op-log adapter issued raw BEGIN/COMMIT on the shared
connection with no serialization. Once both stores share one SqliteDb
(the staged native rollout), concurrent operations (capture append,
archive write, compaction) would interleave BEGINs: SQLite has no
nested transactions, so a second BEGIN throws and a bare statement
issued mid-transaction silently joins — and rolls back with — the
foreign transaction, corrupting op-log state.

Funnel every adapter entry point through an internal FIFO queue so a
transaction is exclusive on the connection for its whole BEGIN/COMMIT
and no bare operation interleaves. Transaction-internal work runs
directly on the connection (already holding the slot), so there is no
re-entrancy. Document the mutual-exclusion invariant in the port
contract and add a concurrent-transactions contract test that runs on
both the in-memory fake and real sql.js.

* docs: add complete architecture review report (2026-07-07)

Whole-app architecture review synthesized from eight parallel subsystem
reviews and an adversarial verification pass; findings filed as issues
#8832-#8843, with duplicates cross-referenced rather than re-filed.

* fix(op-log): key the SQLite transaction serializer to the connection

Multi-agent review found the serializer was keyed to the adapter
instance. The native rollout hands the op-log store and archive store
two separate SqliteOpLogAdapter instances over one shared SqliteDb, so
per-instance queues left an op-log BEGIN free to interleave with a
concurrent archive BEGIN on the shared connection — the exact hazard the
serializer targets.

Key the FIFO queue to the connection (WeakMap<SqliteDb>) so every adapter
over one SqliteDb shares one queue. Add a contract test that drives two
adapters over one connection concurrently (verified red with per-instance
keying, green with per-connection). Also: document the re-entrancy
precondition as unenforced (a lint rule, not a runtime flag, is the right
guard — a flag cannot distinguish a re-entrant call from a legal
concurrent one) and correct init/getLastSeq/port-contract doc drift.
2026-07-07 18:00:25 +02:00
..
2026-03-22-advanced-onboarding-design.md feat(onboarding): add lightweight onboarding hints 2026-03-22 19:50:24 +01:00
2026-05-21-clean-slate-data-loss-prevention.md feat(focus-mode): focus screen UX overhaul (#7586) 2026-06-12 11:59:56 +02:00
2026-05-28-android-keyboard-resize-jank.md feat(focus-mode): focus screen UX overhaul (#7586) 2026-06-12 11:59:56 +02:00
2026-06-05-project-completion.md feat(project): project completion experience (#8036) 2026-06-08 13:43:38 +02:00
2026-06-22-android-keyboard-and-systembars-handover.md docs(android): document SDK 28 (API 28) behind-keyboard add-task bar root cause (#8528) 2026-06-22 13:27:45 +02:00
2026-06-22-android-systembars-migration-corrected.md feat(android): migrate edge-to-edge to built-in SystemBars (#8543) 2026-06-22 16:07:06 +02:00
2026-06-30-plainspace-super-productivity-connect-flow.md feat(plainspace): Collaborate-on-Plainspace discovery + smoother connect (#8649) 2026-07-01 16:39:34 +02:00
2026-07-03-android-home-screen-widget.md feat(android): add home screen widget for today's tasks (#8737) 2026-07-03 18:32:34 +02:00
2026-07-03-sync-engine-extraction-plan.md docs(sync): add sync-engine extraction plan 2026-07-03 16:14:22 +02:00
2026-07-07-complete-architecture-review.md fix(op-log): serialize SQLite adapter transactions on the shared connection (#8849) 2026-07-07 18:00:25 +02:00
2026-07-07-ios-home-screen-widget-port.md docs(plans): add iOS home screen widget port plan 2026-07-07 17:08:48 +02:00