Skip to content

Conversation

@dannykopping
Copy link
Collaborator

Closes #56

Also introduces a new test struct named mockHTTPReflector which reflects an entire HTTP response fixture. This should be the approach going forward, instead of the somewhat janky mockServer. You'll notice in the modified fixtures that they contain a full HTTP payload instead of just the response body. I think this makes it a lot cleaner and more idiomatic.

@dannykopping dannykopping force-pushed the non-stream-err-handling branch from c57a572 to d94d846 Compare November 14, 2025 08:05
return
}

// Initiate the stream once the first event is received.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix, besides the provider-specific implementations.
We can't send the SSE headers until we know whether the stream has started. If the upstream request fails before streaming starts, we have to send back a non-200 response. Once SSE headers are sent, we can't do that.

@dannykopping dannykopping requested a review from pawbana November 14, 2025 08:05
@dannykopping dannykopping marked this pull request as ready for review November 14, 2025 08:05
@dannykopping dannykopping requested a review from pawbana November 17, 2025 12:17
@dannykopping dannykopping merged commit 64eff22 into main Nov 17, 2025
1 check passed
@dannykopping dannykopping deleted the non-stream-err-handling branch November 17, 2025 12:34
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.

bug: errors occurring before stream initiation are not reflected correctly

2 participants