ECHO: stop flagging routine SSE reconnects as monitor degradation - #1025
Draft
posthog-eu[bot] wants to merge 1 commit into
Draft
ECHO: stop flagging routine SSE reconnects as monitor degradation#1025posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
The host live monitor's SSE stream auto-reconnects within a browser retry cycle (~3s) and a 5s fallback poll covers the gap, so a brief flap never reaches the host. The client debounced degradation by only 3s, shorter than the reconnect cycle, so nearly every routine reconnect flipped the "Reconnecting" badge and emitted a monitor_stream_degraded event. Raise the debounce to a 10s grace window and hold the stream "connected" until it elapses. The badge and the degradation event now track genuine, host-visible outages instead of self-healing reconnects. Long real outages still flag. Add a hook test for the brief-flap and sustained-outage paths. Generated-By: PostHog Desktop Task-Id: 4193467a-b415-4422-a5de-0c2b9dbc5a6b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
monitor_stream_degradedevents over 14 days, and the "Reconnecting" badge flickered on the host's screen.Measured over the affected window:
The server side is healthy (15s heartbeats, a 2s poll safety net, and the fallback poll), so there is no outage to fix there. The signal itself was over-sensitive.
Changes
MONITOR_DEGRADE_GRACE_MS) inuseConversationMonitor.connectedthrough the grace window, so the "Reconnecting" badge and themonitor_stream_degradedevent only reflect a stream that fails to recover across several reconnect attempts.Testing
pnpmtypecheck (tsc --noEmit): 0 errors.biome check: clean.vitest run: newuseConversationMonitortests pass;LiveMonitorSectiontests still pass.Agent context
retry:hint on the server, but rejected it: EventSource does not back off, so a shorter interval risks a reconnect storm against a genuinely down server. The client-side grace window is the targeted fix.Created with PostHog Desktop from this inbox report.