Note: SSE-based live updates when data changes from any client
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,23 @@ that records every `set`/`delete` as a timestamped entry. The main file stays a
|
|||||||
clean current-state snapshot; the delta file accumulates the full history. Enables
|
clean current-state snapshot; the delta file accumulates the full history. Enables
|
||||||
undo, audit trails, and debugging data corruption.
|
undo, audit trails, and debugging data corruption.
|
||||||
|
|
||||||
|
## Real-time / live updates
|
||||||
|
|
||||||
|
### Server-sent events for data changes
|
||||||
|
When data changes on the server (upload, edit, delete — from any client), connected
|
||||||
|
browsers should receive a notification and update the affected view automatically.
|
||||||
|
Use case: uploading photos from a phone while the desktop browser has the Images or
|
||||||
|
Bins section open.
|
||||||
|
|
||||||
|
Server-sent events (SSE) are the natural fit — lightweight, one-directional, no
|
||||||
|
library needed. The server emits a change event with a `type` (e.g. `source_images`,
|
||||||
|
`bins`) and the client re-fetches and re-renders only the affected collection.
|
||||||
|
Views that aren't currently visible don't need to do anything — they'll reload on
|
||||||
|
next navigation.
|
||||||
|
|
||||||
|
Ties directly into the delta tracking plan: the same write path that appends to the
|
||||||
|
delta log can also fan out to connected SSE clients.
|
||||||
|
|
||||||
## App architecture
|
## App architecture
|
||||||
|
|
||||||
### parse_url mutates too many module-level variables
|
### parse_url mutates too many module-level variables
|
||||||
|
|||||||
Reference in New Issue
Block a user