feat: surface connection/auth/RPC errors instead of spinning#93
Merged
Conversation
Add a single connection status model (connecting/connected/unauthorized/ disconnected/error) plus connection:status/connection:error/rpc:error events and a DevframeConnectionError to the devframe client, wired from the WebSocket lifecycle and the trust handshake. In-flight and new RPC calls now reject when the socket drops or trust is refused (with an optional callTimeout) instead of hanging forever, so a UI can show why it isn't loading rather than spinning. Expose the status centrally on the hub client context.
Every built-in plugin now renders a clear connection state — connecting, disconnected, unauthorized, or error, with a reload affordance — driven by the devframe client's status, replacing the indefinite spinners that appeared when the socket dropped or auth was refused. git (React), inspect (Vue), terminals (Svelte), code-server (vanilla) and messages (Vue) gate their surface on the status; a11y (Solid) keeps its BroadcastChannel-first UI and surfaces a degraded backend as a quiet tag.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Add a 'Handling connection and auth errors' section to the client guide covering rpc.status, rpc.connectionError, the connection:status / connection:error / rpc:error events, DevframeConnectionError (and its kind), and the callTimeout option, with one framework-neutral recipe that gates the UI on status and branches a failing call on error kind. Refresh the now-stale Events section and options table, and note that a hub viewer can read the same status centrally via context.connection.
antfu
approved these changes
Jul 15, 2026
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.
Why
When the devframe client couldn't reach the server, was refused auth, or lost the socket mid-session, the UI just spun with no feedback — it was never clear what was happening. Root causes:
What
devframe client (core)
@devframes/hub
Built-in plugins
Verification
`pnpm lint && pnpm test && pnpm typecheck && pnpm build` all pass. Added focused client tests covering the status transitions, fail-fast-on-disconnect, and timeout behavior; regenerated the affected tsnapi API snapshots.
This PR was created with the help of an agent.