Implement server sync endpoints #38

Open
opened 2026-10-30 21:03:01 -06:00 by west · 0 comments
Owner

📋 HTTP endpoints designed for the bidirectional sync protocol.

🎯 Acceptance Criteria:

  • POST /sync — receives client cursor + outbox actions, replays them, returns server outbox actions
    • Request: { cursor: N, actions: [{ action_type, entity_type, entity_id, payload }] }
    • Response: { cursor: M, actions: [{ action_type, entity_type, entity_id, payload, sequence_number }] }
  • GET /sync/status — returns current server cursor and last sync times per device
  • On replay: each action is applied to server state with conflict detection
  • Conflict resolution: last-write-wins by entity last_modified timestamp
  • All actions receive server-assigned sequence numbers
  • Proper error handling for malformed payloads
  • Request size limits for batch operations

📝 Notes: This is the most critical server endpoint. It is the heart of the sync system. Based on the protocol designed in SYNC-1.

📋 **HTTP endpoints designed for the bidirectional sync protocol.** 🎯 **Acceptance Criteria:** - [ ] POST /sync — receives client cursor + outbox actions, replays them, returns server outbox actions - Request: { cursor: N, actions: [{ action_type, entity_type, entity_id, payload }] } - Response: { cursor: M, actions: [{ action_type, entity_type, entity_id, payload, sequence_number }] } - [ ] GET /sync/status — returns current server cursor and last sync times per device - [ ] On replay: each action is applied to server state with conflict detection - [ ] Conflict resolution: last-write-wins by entity last_modified timestamp - [ ] All actions receive server-assigned sequence numbers - [ ] Proper error handling for malformed payloads - [ ] Request size limits for batch operations 📝 **Notes:** This is the most critical server endpoint. It is the heart of the sync system. Based on the protocol designed in SYNC-1.
Sign in to join this conversation.
No description provided.