Skip to content

fix: buffer complete secret watch events - #562

Open
Shubham-Padkonde wants to merge 1 commit into
DopplerHQ:masterfrom
Shubham-Padkonde:fix/frame-secret-watch-events
Open

Shubham-Padkonde wants to merge 1 commit into
DopplerHQ:masterfrom
Shubham-Padkonde:fix/frame-secret-watch-events

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Fixes #536.

The watch reader currently passes each network read directly to the event parser. A read can contain part of an event or several events, so valid server responses can produce parse errors and missed updates.

Buffer lines until the blank line ending each SSE frame, normalize CRLF to LF for the existing parser, and dispatch each complete frame separately. An incomplete final frame is discarded; the connection error still propagates to the existing reconnect logic. Callback dispatch remains asynchronous.

Validation: all package tests pass (go test ./pkg/...), and the HTTP package passes with the race detector. Four local HTTP regressions fail before this change and pass afterward: combined events, an event larger than the old 1024-byte buffer, CRLF frames, and a truncated final event. Formatting and git diff --check pass. The authenticated end-to-end suite was not run.

@Shubham-Padkonde
Shubham-Padkonde requested a review from a team as a code owner October 2, 2026 04:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

doppler run --watch: SSE keepalive frames fail to parse — "unexpected end of JSON input" every ~30s

1 participant