Back to Super Productivity

Operation Log & Sync Documentation

docs/sync-and-op-log/README.md

18.6.05.9 KB
Original Source

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 correctlycontributor-sync-model.md — the one invariant, enforced by lint
Understand the whole architecture + why it's built this wayoperation-log-architecture.md — Parts A–F + rejected alternatives
See it visuallydiagrams/ — 8 topic diagrams

Reference docs

DocumentScope
operation-log-architecture.mdAuthoritative 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.mdThe single sync invariant for contributors (one intent = one op; replayed/remote ops must not re-trigger effects)
operation-rules.mdDesign rules and guidelines for operations
package-boundaries.mdDependency/ownership boundaries for @sp/sync-core, @sp/sync-providers, app wiring
vector-clocks.mdVector clock implementation, pruning, history
supersync-encryption-architecture.mdEnd-to-end encryption (AES-256-GCM + Argon2id)
diagrams/Mermaid diagrams split by topic

Scenario catalogs (expected behavior)

DocumentScope
supersync-scenarios.mdConcrete SuperSync scenarios A–G with expected behavior
supersync-scenarios-flowchart.mdVisual decision tree for the SuperSync scenarios
file-based-sync-flowchart.mdVisual decision tree for file-based providers
LocationContent
packages/super-sync-server/SuperSync server implementation
ARCHITECTURE-DECISIONS.mdLoad-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).