Repository navigation
fix(app): stop a removed server's route from taking the renderer down - #244
Merged
Merged
Conversation
Deleting a sandbox while one of its sessions was open crashed the window to
the fatal error screen with "Invalid server route", and since the desktop
restores the last active route on launch, every relaunch crashed again until
the persisted URL happened to change.
requireServerKey throws on a segment that is missing or does not round-trip,
and both route call sites ran it during render, so the throw escaped from a
memo and killed the renderer. The param goes missing in ordinary use: removing
a server navigates away (tabs.removeServer -> navigate("/")) and the route's
params clear before its subtree unmounts.
The routes now read the key through a non-throwing serverKeyFromRoute.
Rendering nothing was not enough by itself — a /server/… route that cannot
mount its providers leaves the shell half-built and fails further down in the
command registry — so an unreadable key redirects home instead.
Verified against the running app: a route pointing at a deleted server now
recovers to a valid route with no renderer errors, where before it was fatal.
Also stops a lone job announcing itself as "waiting for another sandbox": the
status now starts as running when nothing (that is not already superseded) is
ahead of it in the queue.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
quickbeard
force-pushed
the
fix/sandbox-route-crash
branch
from
August 16, 2026 05:15
ff0bc89 to
4d4bd53
Compare
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.
Deleting a sandbox while one of its sessions was open crashed the window to the fatal "Something went wrong" screen with
Error: Invalid server route. And because the desktop restores the last active route on launch, every relaunch crashed again until the persisted URL happened to change.Cause
requireServerKeythrows when the route segment is missing or does not round-trip:Both route call sites ran it during render — one inside a
createMemo, one as a JSX prop — so the throw escaped a reactive computation and took the whole renderer down.And the param does go missing in ordinary use: removing a server navigates away (
tabs.removeServer→navigate("/")), and the route's params clear before its subtree unmounts. That is exactly the delete-a-sandbox path.Fix
serverKeyFromRouteis a non-throwing variant;requireServerKeyis now defined in terms of it and kept for callers that want the throw. The two route components use the non-throwing one.Rendering nothing turned out not to be enough on its own: a
/server/…route that cannot mount its providers leaves the shell half-built and then fails further down in the command registry (reg.options is not a function, in a tight loop). So an unreadable key redirects home rather than sitting on a route that can never render.Verified against the running app
I drove the real desktop app over the DevTools protocol rather than reasoning about it:
crashed: falseand zero renderer errors.Also in this PR: a lone sandbox job briefly announced itself as "Waiting for another sandbox…" before starting. The status now starts as
runningwhen nothing (that is not already superseded) is ahead of it in the queue, with a test pinning it.Scope
This is an upstream bug of the same class as the
project-avatar-state.tsguard already inDIVERGENCES.md— any removal, restart, or crash of a sidecar server drops its key while routes and tabs still point at it. A new divergence row records the guard and warns against "simplifying" the route back torequireServerKey.Tests:
packages/app675 pass,packages/codev-sandbox146 pass (1 new),packages/desktop96 pass;bun typecheckclean in all three.🤖 Generated with Claude Code