Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): Recover thread state reliably after reconnects #4034

Closedjuliusmarmingewants to merge 4 commits intot3code/audit-mobile-thread-sync fromrefs/pull/4034/headopened View on GitHub

Showing 10 changed files with 130 additions and 10 deletions (loading 7).

x
0 of 10 viewed, 10 left
101 additions and 5 deletionsapps/mobile/src/features/threads/ThreadRouteScreen.tsxModified
View file
@@ -31,7 +31,7 @@
useRemoteEnvironmentRuntime,
} from "../../state/use-remote-environment-registry";
import { useKnownTerminalSessions } from "../../state/use-terminal-session";
-import { useSelectedThreadDetailState } from "../../state/use-thread-detail";
+import { useSelectedThreadDetailQuery } from "../../state/use-thread-detail";
import { useThreadSelection } from "../../state/use-thread-selection";
import { GitActionProgressOverlay } from "./GitActionProgressOverlay";
import {
@@ -78,6 +78,11 @@
​
type NativeHeaderItems = ReadonlyArray<Record<string, unknown>>;
​
+const THREAD_DETAIL_STALL_RETRY_DELAYS_MS = [8_000, 12_000] as const;
+const THREAD_DETAIL_STALL_ERROR_DELAY_MS = 20_000;
+const THREAD_DETAIL_STALL_ERROR =
+ "The conversation did not finish loading. Close and reopen the thread to retry.";
+​
function InspectorPaneRoleActivation() {
useAdaptiveWorkspacePaneRole("inspector");
return null;
@@ -144,7 +149,91 @@
selectedThread === null
? null
: scopedThreadKey(selectedThread.environmentId, selectedThread.id);
- const selectedThreadDetailState = useSelectedThreadDetailState();
+ const selectedThreadDetailQuery = useSelectedThreadDetailQuery();
+ const selectedThreadDetailState = selectedThreadDetailQuery.state;