fix(cloud): retry RPC posts once on webview transport failures#488
Merged
Conversation
WKWebView reuses pooled keep-alive sockets that the server may have silently closed, and CFNetwork never auto-retries a POST on a fresh connection — so the first cloud mutation after idle (create invite, change role, set floor) deterministically failed with a raw WebKit "Load failed". Retry such transport-level TypeErrors exactly once across all org2 cloud RPC clients and the GoTrue token refresh, and translate the residual failure instead of surfacing the raw message. Pre-commit hook ran. Total eslint: 0, total circular: 1
Carry the turn source from every frontend dispatch boundary through the Rust agent wire so Send Now remains a fresh turn even when the cancelled provider turn is still draining. Only ordinary user submissions may enter mid-turn steering. Require and validate the source at the Tauri boundary, reject unknown persisted values instead of silently coercing them to user_submit, and add wire, steering, queue, and persistence regression coverage. Verification: - pnpm exec tsc --noEmit --pretty false - pnpm exec vitest run src/store/ui/__tests__/messageQueueAtom.test.ts src/engines/SessionCore/hooks/session/__tests__/useQueueDispatch.classify.test.ts src/engines/SessionCore/hooks/session/__tests__/useQueueDispatch.intervention.test.ts src/engines/SessionCore/sync/adapters/__tests__/rustAgentSendPayload.test.ts src/engines/ChatPanel/hooks/useWorkspaceChat/useUserIntentSubmit.intervention.test.ts - cargo check -p agent_core - cargo check -p session_persistence - cargo test -p agent_core force_send_never_enters_mid_turn_steering --lib - cargo test -p session_persistence --lib -- --test-threads=1 Pre-commit hook ran. Total eslint: 0, total circular: 1
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.
Summary
Load failedbecause CFNetwork reuses a silently closed keep-alive socket and never auto-retries POSTs.fetchWithTransportRetryhelper and wire it through all org2 cloud RPC clients (management, sync, comments, shares, projects, reads) plus GoTrue token refresh.cloud.orgManagement.errors.networkmessage instead of surfacing WebKit's raw error.Test plan
Load failed)Load failedorg2CloudFetchRetry, management client retry cases, and Org2Cloud suite already green locally (591 tests)