Skip to content

fix(api): bound the SSE per-connection seen-set (#183 follow-up)#185

Merged
brownjuly2003-code merged 1 commit into
mainfrom
fix-sse-bounded-seen-set
Jul 10, 2026
Merged

fix(api): bound the SSE per-connection seen-set (#183 follow-up)#185
brownjuly2003-code merged 1 commit into
mainfrom
fix-sse-bounded-seen-set

Conversation

@brownjuly2003-code

Copy link
Copy Markdown
Owner

What

/v1/stream/events kept a bare per-connection set that grows one entry per distinct event for as long as the SSE connection stays open — the same disease as #183, scoped to a connection. Hours of sustained traffic mean hundreds of MB per open stream.

Fix

Tests

  • Spy test pins that the generator builds a BoundedSeenSet(maxlen=SEEN_CACHE_SIZE) — reverting to a bare set fails it.
  • Behavioral test with a tiny cache (3) drives 5 distinct ids through eviction and asserts every id is emitted exactly once.
  • Docs: CHANGELOG + serving-bridge.md §Journal scans are bounded gets the SSE bullet.

🤖 Generated with Claude Code

/v1/stream/events kept a bare set growing one entry per distinct event
for the connection's lifetime. BoundedSeenSet at SEEN_CACHE_SIZE=10000;
eviction cannot re-emit because the scan window is the newest 10 rows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

DORA Metrics

  • Window: last 30 days
  • Branch: main
  • Deployment frequency: 105 total / 24.5 per week
  • Lead time for changes: avg 0.37h / median 0.0h
  • Change failure rate: 64.76% (68/105)
  • MTTR: 2.56h across 1 incident(s)

@brownjuly2003-code brownjuly2003-code merged commit 6539a7a into main Jul 10, 2026
23 checks passed
@brownjuly2003-code brownjuly2003-code deleted the fix-sse-bounded-seen-set branch July 10, 2026 21:21
brownjuly2003-code pushed a commit that referenced this pull request Jul 10, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to 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.

2 participants