memos/web
Cursor Agent 8c743c72ba feat: add live memo refresh via Server-Sent Events (SSE)
Implement real-time memo synchronization across all open browser instances
using Server-Sent Events (SSE). When a memo is created, updated, or
deleted on one device, all other connected clients receive the change
notification and automatically refresh their data.

Backend changes:
- Add SSEHub (pub/sub) for broadcasting memo change events to connected clients
- Add SSE HTTP endpoint at /api/v1/sse with Bearer token authentication
  (supports both Authorization header and query parameter for EventSource)
- Broadcast memo.created, memo.updated, and memo.deleted events from
  the memo service after successful operations
- Include SSEHub in APIV1Service and wire it into server initialization
- Update test helper to include SSEHub to prevent nil pointer panics

Frontend changes:
- Add useLiveMemoRefresh hook that connects to SSE endpoint using fetch
  ReadableStream (supports custom auth headers unlike native EventSource)
- Automatically invalidate React Query caches on received events:
  - memo.created: invalidate memo lists + user stats
  - memo.updated: invalidate specific memo detail + memo lists
  - memo.deleted: remove memo from cache + invalidate lists + user stats
- Exponential backoff reconnection (1s to 30s) on connection failures
- Integrate hook in AppInitializer for app-wide live refresh
- Add SSE-specific Vite dev proxy config with no timeout for streaming

Co-authored-by: milvasic <milvasic@users.noreply.github.com>
2026-02-06 21:18:21 +00:00
..
docs refactor(react-query): optimize config, add error boundary, and remove JSDoc 2025-12-25 08:47:36 +08:00
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src feat: add live memo refresh via Server-Sent Events (SSE) 2026-02-06 21:18:21 +00:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
biome.json refactor: remove MemoContentContext and integrate MemoViewContext 2025-12-28 12:46:12 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
index.html chore: prevent sensitive data caching 2025-12-20 12:33:16 +08:00
package.json fix: KaTeX math rendering with underscores (#5438) 2026-01-06 20:16:01 +08:00
pnpm-lock.yaml fix: KaTeX math rendering with underscores (#5438) 2026-01-06 20:16:01 +08:00
tsconfig.json chore: clean up unused imports and parameters across components 2025-12-27 10:18:38 +08:00
vite.config.mts feat: add live memo refresh via Server-Sent Events (SSE) 2026-02-06 21:18:21 +00:00