Skip to content

Implement a CRDT-based client-side sync engine using IndexedDB for offline-capable governance voting #469

Description

@Damola-Sodiq

Description

Engineer a local-first synchronization engine utilizing Conflict-free Replicated Data Types (CRDTs) to allow users to draft and queue governance votes offline.

Architecture & Context

For governance of fractional token parameters, users need to read proposals and vote regardless of network stability. By capturing votes as CRDT vectors in IndexedDB, the client can deterministically merge state with the backend once connectivity returns.

Technical Requirements

  • Integrate Yjs or Automerge specifically optimized for browser usage.
  • Utilize Dexie.js for persistent storage of offline mutations.
  • Implement a Service Worker background sync event to flush pending vectors automatically.

Acceptance Criteria

  • Users can successfully draft, edit, and queue votes entirely offline.
  • Reconnecting perfectly synchronizes the local state with the tRPC backend.
  • Concurrent tab edits resolve deterministically without data loss.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions