Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): reopening a running thread shows its cached messages right away #24210

Closedshivamhwp(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/24210/headopened View on GitHub

Showing 2 changed files with 51 additions and 2 deletions.

x
0 of 2 viewed, 2 left
48 additions and 1 deletionpackages/client-runtime/src/state/threads-sync.test.tsModified
View file
@@ -3,6 +3,7 @@
EventId,
MessageId,
ORCHESTRATION_V2_WS_METHODS,
+ RunId,
ThreadId,
TurnItemId,
type OrchestrationV2ThreadDetailSnapshot,
@@ -43,7 +44,7 @@
decodeOrDiscardOrchestrationCache,
} from "../platform/orchestrationCache.ts";
import * as RpcSession from "../rpc/session.ts";
-import { v2Projection, v2ThreadId } from "./orchestrationV2TestFixtures.ts";
+import { v2Now, v2Projection, v2ThreadId } from "./orchestrationV2TestFixtures.ts";
import { EMPTY_THREAD_HISTORY_META } from "./threadHistoryMerge.ts";
import * as ThreadHistoryController from "./threadHistoryController.ts";
import {
@@ -1724,6 +1725,52 @@
+ // regression: #24192 reopening a running thread on mobile waited on the server with a blank view
+ it.effect("caches a running thread once when its view closes, not on each update", () =>
+ Effect.gen(function* () {
+ const scope = yield* Scope.make();
+ const harness = yield* makeHarness().pipe(Effect.provideService(Scope.Scope, scope));
+ const running: OrchestrationV2ThreadProjection = {
+ ...BASE_PROJECTION,