Build web v2 session workbench slice#101
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9278489080
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| setState((current) => ({ ...current, loading: true })); | ||
|
|
||
| async function load() { | ||
| const session = await trpc.controlPlane.session.query({ id }); |
There was a problem hiding this comment.
Handle rejected session queries to clear loading state
If trpc.controlPlane.session.query rejects (for example, transient network failure or server error), this effect never catches the exception, so loading remains true and the rejection is unhandled in the browser. Because setState({ session, loading: false }) is only reached on success, the session view can stay stuck in a perpetual loading state until a later successful fetch or remount.
Useful? React with 👍 / 👎.
| let cancelled = false; | ||
|
|
||
| async function load() { | ||
| const state = await trpc.controlPlane.state.query(); |
There was a problem hiding this comment.
Catch sidebar state query failures in one-shot loader
This one-shot sidebar loader runs only once ([] deps), but it does not handle errors from trpc.controlPlane.state.query. When that request fails, the promise rejection is unhandled and sessions/tasks stay at their initial empty arrays with no retry path, which leaves the navigation lists blank for the remainder of the mount.
Useful? React with 👍 / 👎.
a5cd36b to
f51cc7f
Compare
f51cc7f to
3b98c67
Compare
Summary
Verification