Repository navigation
fix(tui): preserve session route on transient errors - #39419
Closed
kitlangton wants to merge 1 commit into
Closed
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
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.
What
Keep the selected session route when session hydration fails for a transient reason. Existing sessions remain navigable after the managed background service reconnects instead of appearing to disappear.
Before / After
Before: Selecting an existing session started its hydration requests. If the background service was stopping or restarting, a transient transport error or undeclared
503rejected hydration. The session route treated every rejection as if the session did not exist and immediately navigated home, so repeatedly selecting old sessions appeared to do nothing.After: Only a decoded
SessionNotFoundErrornavigates home. Other hydration failures still surface a toast, but the selected route remains intact. The existing connection-status effect can hydrate that same session when the event stream reconnects.How
packages/tui/src/routes/session/index.tsxuses the generatedisSessionNotFoundErrorguard before discarding the current route.Scope
This PR does not retry arbitrary API mutations or change managed-service restart behavior. It only prevents transient session-load failures from being misclassified as missing sessions.
Testing
bun typecheckfrompackages/tuibun run test test/cli/tuifrompackages/tui: 129 passed, 1 skippedbun turbo typecheck --concurrency=3: 33 packages passedDemo
No recording attached. The visible failure depends on hitting the managed-service replacement window; the change preserves the route at the exact error boundary without simulating a successful server response.
Flow
sequenceDiagram participant User participant TUI participant Service User->>TUI: Select existing session TUI->>Service: Hydrate session Service-->>TUI: Transient failure during restart TUI->>TUI: Keep selected route and show error Service-->>TUI: Event stream reconnects TUI->>Service: Hydrate selected session again Service-->>TUI: Existing session