mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
* chore: add project-scoped Angular MCP * chore: update npm for release-age policy * fix(sync): preserve LWW outcomes across clients Distinguish replacement snapshots from partial merge operations, protect device-local sync configuration, recreate winning deletes, and resolve every conflicted entity in bulk operations. Fixes #8956 * fix(sync): harden mixed LWW conflict replay Preserve unaffected remote and local bulk intents, keep device-local sync settings during replacement replay, and gate replacement semantics behind schema v3. * fix(sync): recover subtask subtree and harden LWW replay follow-ups Follow-up hardening for #8956 after multi-agent review: - Recreate a locally-winning parent's subtasks when a remote bulk delete is a mixed winner. The full remote delete is applied (cascade-deleting the parent's subtasks via handleDeleteTasks) but only the parent had a compensation op, so the subtree was silently lost across devices. - extractUpdateChanges: scan array-valued payload props instead of guessing `${payloadKey}s`, so irregular bulk keys (e.g. taskUpdates) no longer return {} and drop a remote winner's changes. - Degrade gracefully instead of throwing when a remote update wins over a local delete with no reconstructable base entity, matching the single-entity path (a permanent sync wedge is worse than the bounded divergence it already accepts). - Remove dead code (unused `deleting` set + zero-caller wrapper), use the Set-based scoped-bulk-delete filter, type meta via LwwUpdateMode, and restore the withLocalOnlySyncSettings rationale comment. Adds regression tests for the subtree-recovery and irregular-bulk-key paths. * fix(sync): preserve conflict outcomes during replay Persist replacement LWW operations and bulk-delete snapshots so reconstructed state matches the result applied live. Bump the op-log DB version to prevent older clients from opening the incompatible schema. * fix(sync): persist conflict outcomes atomically Write remote losers, local compensations, and final remote winners in one IndexedDB transaction so crashes cannot expose a partial replay order. Add real-store coverage for live/replay equivalence and transaction rollback. * fix(sync): preserve multi-entity conflict recovery * fix(sync): close review gaps in multi-entity conflict recovery - recreate a winning parent's subtasks when a remote DELETE loses outright (single-entity or all-local-win bulk), so clients that applied the delete and status-blind hydration replay converge - apply the combined resolution batch in durable seq order so a pending row reused from a prior failed attempt replays identically live and after a crash - restamp converted remote updates carrying the v3 replacement envelope to the current schema version - strip the virtual TODAY tag from LWW task payloads and shallow-merge patch-mode singleton payloads instead of replacing feature state - pin the server snapshot fast-path spec to CURRENT_SCHEMA_VERSION (fixes the CI failure from the v2-to-v3 bump) * test(sync): pin outright-losing delete convergence across clients Three-way real-reducer/real-store convergence for the pure-loser path (live == restart replay == originating client), covering both the same-batch recreate exemption and the cross-batch recreate path. Verified to fail against the pre-fix service. |
||
|---|---|---|
| .. | ||
| diagrams | ||
| conflict-journal-and-review.md | ||
| contributor-sync-model.md | ||
| file-based-sync-flowchart.md | ||
| operation-log-architecture.md | ||
| operation-rules.md | ||
| package-boundaries.md | ||
| README.md | ||
| sqlite-migration-followup.md | ||
| sqlite-migration.md | ||
| supersync-encryption-architecture.md | ||
| supersync-scenarios-flowchart.md | ||
| supersync-scenarios.md | ||
| vector-clocks.md | ||
Operation Log & Sync Documentation
The Operation Log is the single sync system for all providers (SuperSync, WebDAV, Dropbox, LocalFile). It is an event-sourced persistence + sync layer: the log is the source of truth, current state is derived by replaying it, and vector clocks detect concurrent edits.
User Action
│
▼
NgRx Store (runtime source of truth)
│
┌───────────────────┼───────────────────┐
▼ │ ▼
OpLogEffects │ Other Effects
│ │
├──► SUP_OPS ◄───────┘ (local persistence — IndexedDB)
│
└──► Sync Providers
├── SuperSync (operation-based, real-time)
└── WebDAV / Dropbox / LocalFile (file-based, single sync-data.json)
Start here
| You want to… | Read |
|---|---|
| Write an effect/reducer/bulk-dispatch correctly | contributor-sync-model.md — the one invariant, enforced by lint |
| Understand the whole architecture + why it's built this way | operation-log-architecture.md — Parts A–F + rejected alternatives |
| See it visually | diagrams/ — 8 topic diagrams |
Reference docs
| Document | Scope |
|---|---|
| operation-log-architecture.md | Authoritative architecture: Local Persistence (A), File-Based Sync (B), Server Sync (C), Validation & Repair (D), Smart Archive (E), Atomic State Consistency (F), and Why this architecture: rejected alternatives |
| contributor-sync-model.md | The single sync invariant for contributors (one intent = one op; replayed/remote ops must not re-trigger effects) |
| operation-rules.md | Design rules and guidelines for operations |
| package-boundaries.md | Dependency/ownership boundaries for @sp/sync-core, @sp/sync-providers, app wiring |
| conflict-journal-and-review.md | Conflict journal (device-local record of LWW auto-resolutions), disjoint-field auto-merge, /sync-conflicts review UI |
| vector-clocks.md | Vector clock implementation, pruning, history |
| supersync-encryption-architecture.md | End-to-end encryption (AES-256-GCM + Argon2id) |
| diagrams/ | Mermaid diagrams split by topic |
Scenario catalogs (expected behavior)
| Document | Scope |
|---|---|
| supersync-scenarios.md | Concrete SuperSync scenarios A–G with expected behavior |
| supersync-scenarios-flowchart.md | Visual decision tree for the SuperSync scenarios |
| file-based-sync-flowchart.md | Visual decision tree for file-based providers |
Related
| Location | Content |
|---|---|
| packages/super-sync-server/ | SuperSync server implementation |
| ARCHITECTURE-DECISIONS.md | Load-bearing product/data decisions |
Historical design notes and superseded plans are not kept as docs; they live in git history (reference the relevant commit if you need the rationale).