managarten/services/mana-sync/internal
Till JS 068a64b275 feat(sync): add SSE streaming endpoint for real-time sync
New endpoint GET /sync/{appId}/stream sends Server-Sent Events with
change data directly, replacing the WebSocket notification + HTTP pull
round-trip pattern.

Server (Go):
- HandleStream() in handler.go: SSE endpoint with initial sync + live streaming
- Hub.Subscribe()/Unsubscribe() in hub.go: channel-based SSE subscriber system
- Notification type for type-safe SSE events
- convertChanges() helper extracted from duplicated code
- WriteTimeout set to 0 for SSE long-lived connections

Protocol: Client connects to /sync/{appId}/stream?collections=a,b&since=...
Server sends initial changes, then streams live changes as other clients sync.
Heartbeat every 30s keeps connection alive. Push still uses POST /sync/{appId}.

WebSocket remains available as fallback (not removed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:24:10 +02:00
..
auth refactor(shared-go): extract shared auth package from 3 Go services 2026-04-02 13:27:44 +02:00
config harden(mana-sync): fix WebSocket auth, add validation, tests, and docs 2026-03-28 02:41:56 +01:00
store feat(sync): add pull pagination with hasMore flag 2026-04-02 22:17:20 +02:00
sync feat(sync): add SSE streaming endpoint for real-time sync 2026-04-02 22:24:10 +02:00
ws feat(sync): add SSE streaming endpoint for real-time sync 2026-04-02 22:24:10 +02:00