Skip to content
TypeScript

test(server): a fork that stops its own PR watch keeps it as its ended watch (#21309)

Julius Marmingee57e6295cf7e
diff --git a/apps/server/src/orchestration-v2/ThreadFork.execution.test.ts b/apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
index 537ca3a6146..920b5fe321b 100644
--- a/apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
+++ b/apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
@@ -192,7 +192,12 @@ it.effect("a persisted fork leaves PR watching with its parent until explicitly
watching: false,
});
const stoppedFork = yield* orchestrator.getThreadShell(targetThreadId);
- assert.deepEqual(stoppedFork?.pullRequests, fork.pullRequests);
+ const [forkLink] = fork.pullRequests ?? [];
+ assert.isDefined(forkLink);
+ // The fork remembers its own watch, never the parent's, so watching again resumes from it.
+ assert.deepEqual(stoppedFork?.pullRequests, [
+ { ...forkLink, endedWatch: watchingFork.pullRequests[0].watch },
+ ]);
assert.deepEqual(stoppedFork?.pendingBackgroundTasks, []);
assert.deepEqual(yield* orchestrator.getThreadShell(sourceThreadId), parentBefore);
}).pipe(Effect.provide(forkCases[0]!.layer)),