Repository navigation
fix(client-runtime): recover queries after reconnects - #8
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9c36ab1e3
ℹ️ 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".
| case "connecting": | ||
| case "backoff": | ||
| return Effect.never; | ||
| case "available": |
There was a problem hiding this comment.
Keep queries waiting during the initial connection
When a query mounts immediately after a supervisor is acquired, the supervisor still starts in available with no session (connection/supervisor.ts:235-242) because connect only queues ConnectRequested (connection/supervisor.ts:756-761). Treating that transient state as a failure makes every normal initial connection publish EnvironmentRpcUnavailableError; the web/mobile query hooks display any Failure even while it is waiting, so users can see a spurious “not connected” error until the first RPC succeeds. Keep this state waiting until the queued connection attempt advances, or update the supervisor state synchronously when connecting.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12495e88d9
ℹ️ 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".
| switch (connectionState.phase) { | ||
| case "connected": | ||
| return Option.isSome(session) | ||
| ? runInEnvironment(target.environmentId, options.execute(target.input)) |
There was a problem hiding this comment.
Avoid preserving disconnect failures as query errors
When the transport drops after this branch observes Some(session) but before options.execute calls currentSession, the request can still fail with EnvironmentRpcUnavailableError; the subsequent session-ref emission recomputes the atom with Effect.never, but makeEffect carries that settled failure forward as a waiting Failure, which the web/mobile query hooks render until reconnection succeeds. Fresh evidence beyond the earlier initial-state report is this non-atomic second session read during an established query, so the unavailable failure must be converted back to a non-failure waiting state when the session disappears rather than being preserved like a genuine RPC failure.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Recover environment queries after a provider session is replaced during reconnects while preserving genuine query failures.
Validation
Upstream reference: pingdotgg/t3code#8117