You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Malformed or temporarily unavailable server route segments currently throw outside the session error boundary and crash the entire desktop renderer.
This change adds non-throwing server-key parsing at the outer route boundary and redirects invalid or unavailable server routes home, while preserving strict parsing for callers that require a valid key.
Tests:
bun test --conditions=solid --preload ./happydom.ts ./src/shell/routes/session.test.ts
AI code review — automated review for reference; please use your judgment.
packages/app/src/shell/routes/routes.tsx:54 — fallback={<Navigate href="/" />} fires whenever the connection lookup misses — including transiently, e.g. while global.servers is still loading at app boot. A structurally valid deep link can then bounce the user home depending on timing. Why it matters: recovery for garbage keys (good) becomes indistinguishable from "server not loaded yet" (bad). Suggestion: only navigate when parseServerKey fails; render a loading/spinner state while the key parses but the registry hasn't settled.
packages/app/src/new-session/composer-adapter.ts:73 — tabs.updateDraft(props.draftID, { worktree: undefined }) was dropped entirely, not just moved out of the transition. If promoteDraft removes the draft entry this is fine, but any persisted draft state (composer persistence survives restarts?) may keep a stale worktree. Why it matters: resurrected drafts could reopen against an outdated worktree. Suggestion: confirm removal is intentional and covered by promoteDraft, or keep the clearing step.
packages/app/src/shell/tabs/tabs.tsx:234 — promoteDraft is now awaited by callers and internally awaits startTransition; if that transition suspends indefinitely, submission.retarget(...) in the composer adapter never runs and the sent message loses its target. Why it matters: a rare suspense stall turns into a silent lost-submit. Suggestion: document the assumption or bound the wait (e.g. resolve once the store update is applied rather than the full transition).
packages/app/src/shell/routes/session.test.ts:15 — New parseServerKey cases are good, but nothing pins the route-level recovery behavior (invalid key ⇒ redirected home instead of thrown). Why it matters: item 1's policy decision lives exactly there, untested. Suggestion: add a small render test asserting <Navigate> fallback on malformed keys and no redirect for well-formed-but-pending keys (per suggested fix).
— automated review (ox-alpha, round2)
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
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.
Malformed or temporarily unavailable server route segments currently throw outside the session error boundary and crash the entire desktop renderer.
This change adds non-throwing server-key parsing at the outer route boundary and redirects invalid or unavailable server routes home, while preserving strict parsing for callers that require a valid key.
Tests:
bun test --conditions=solid --preload ./happydom.ts ./src/shell/routes/session.test.tsbun typecheck