Skip to content

feat(timer): sync open tabs via SSE - #26

Merged
MegaBadCoder merged 1 commit into
mainfrom
feat/timer-sse
Aug 13, 2026
Merged

feat(timer): sync open tabs via SSE#26
MegaBadCoder merged 1 commit into
mainfrom
feat/timer-sse

Conversation

@MegaBadCoder

Copy link
Copy Markdown
Owner

Summary

  • SSE endpoint GET /api/events emits timer.updated on start, pause, stop, and expiry
  • Open clients restore timer state from GET /tasks/timer instead of applying the event payload
  • Caddy flushes /api/events immediately (flush_interval -1) so the stream is not buffered

Test plan

  • Two tabs: start timer in one → the other picks up the session without refresh
  • Pause in one tab → the other pauses to the same remaining time
  • Stop/reset in one tab → the other clears the timer
  • After deploy: Caddy container restarted so the new Caddyfile is live
  • Local (no Caddy): Vite → localhost:3002 still streams

Made with Cursor

When a timer starts, pauses, or stops, other open clients restore state from the backend instead of staying stale.
Co-authored-by: Cursor <cursoragent@cursor.com>
@MegaBadCoder
MegaBadCoder merged commit 5caa9d6 into mainAug 13, 2026
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@MegaBadCoder