fix(bff,ui): prevent SSE write-after-close and improve stream error handling - #113
Merged
Merged
Conversation
…andling
During long-running Helm operations, intermediate proxies (RHOAI
dashboard proxy, OpenShift Router/HAProxy) can sever the SSE
connection. This caused ERR_INCOMPLETE_CHUNKED_ENCODING in the browser
and a generic "Network error" in the progress modal, even though the
operation completed successfully in the background.
BFF: track connection state via res.on('close') and guard all
res.write/res.end calls — prevents writing to a dead socket and
leaking the heartbeat interval.
Frontend: catch network errors from reader.read() during SSE streaming
and surface a user-friendly "Connection lost" message instead of raw
TypeError. Preserve last-known step progress in the modal on
stream interruption.
Merged
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.
Summary
res.on('close'), skipres.write()/res.end()after client disconnect, and clear the heartbeat interval on close. PreventsERR_INCOMPLETE_CHUNKED_ENCODINGerrors caused by intermediate proxy timeouts during long Helm operations.reader.read()during SSE streaming and throwStreamInterruptedErrorwith a user-friendly message instead of surfacing rawTypeError. Preserve last-known step progress in the modal on stream interruption.Same fix as rh-ai-community-plugins/quickstarts-manager — both plugins share the same SSE pattern and were affected by the same bug.
Test plan