feat: surface mid-stream gadget errors to the user - #94
Open
atharrva01 wants to merge 4 commits into
Open
Conversation
Contributor
Author
There was a problem hiding this comment.
Pull request overview
Surfaces mid-stream gadget/port-forward failures to users by detecting dropped WebSocket connections and displaying a dismissible inline error alert on the Gadget Details page.
Changes:
- Listen for underlying WebSocket
closeevents in the port-forward hook to detect transport-level disconnects. - Thread a
setStreamErrorcallback through renderer/callback layers to propagate stream failures up to the UI. - Render a MUI
Alerton Gadget Details when a stream error occurs and clear it on subsequent starts.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/gadgets/igSocket.tsx | Adds a raw WebSocket close listener to detect transport disconnects and update connection state. |
| src/common/GenericGadgetRenderer/index.tsx | Passes stream error callback into gadget callbacks and raises UI stream errors on run/setup errors and disconnects. |
| src/gadgets/gadgetDetails.tsx | Introduces streamError state and displays a dismissible MUI error alert; clears on Start/Run. |
| src/gadgets/utility.tsx | Extends createGadgetCallbacks to report gadget errors via an optional stream error callback. |
| src/gadgets/resourcegadgets.tsx | Minor import ordering adjustment. |
| src/common/GadgetContext/index.tsx | Minor import ordering adjustment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
@atharrva01 some copilot comments, can you take a look please |
Contributor
Author
|
@ashu8912 , the comments are resolved... PTAL |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description:
If the gadget connection drops mid-stream (pod deleted, network issue, etc.), the UI used to just freeze while still showing “Running.”
I added a dismissible inline alert on the Gadget Details page so users immediately know the stream has failed instead of guessing.
Changes:
closeevents to catch dropped connectionssetStreamErrorcallback through the rendererBefore/After: