Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(mobile): omit duplicated turn items from bounded thread snapshots #15385

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/15385/headmerged by juliusmarminge View on GitHub

Showing 15 changed files with 137 additions and 6 deletions (loading 13).

x
0 of 15 viewed, 15 left
103 additions and 0 deletionsapps/server/src/orchestration-v2/ThreadStream.test.tsModified
View file
@@ -1,5 +1,6 @@
import {
EventId,
+ OrchestrationV2ThreadStreamItem,
ThreadId,
TurnItemId,
type OrchestrationV2ProjectedTurnItem,
@@ -8,6 +9,8 @@
} from "@t3tools/contracts";
import { describe, expect, it } from "vite-plus/test";
import * as DateTime from "effect/DateTime";
+import * as Schema from "effect/Schema";
+import { boundedSnapshotProjection } from "@t3tools/shared/orchestrationV2BoundedSnapshot";
​
import {
buildBoundedThreadStreamSnapshot,
@@ -262,3 +265,103 @@
).toEqual({ mode: "replay", afterSequence: 9, throughSequence: 10 });
});
});
+​
+describe("compact bounded snapshots", () => {
+ const FORK_PARENT = ThreadId.make("thread-stream-parent");
+ const decodeStreamItem = Schema.decodeUnknownSync(
+ Schema.toCodecJson(OrchestrationV2ThreadStreamItem),
+ );
+ const encodeStreamItem = Schema.encodeSync(Schema.toCodecJson(OrchestrationV2ThreadStreamItem));
+​
+ /** Fork child: inherited parent rows and marker, then local rows, plus an older interrupt request. */