Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): stop decoding unrelated events during startup #12846

Mergedextoci(GitHub profile, opens in a new tab)merged 2 commits intot3code/codex-turn-mapping fromrefs/pull/12846/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 167 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
167 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsAdded
View file
@@ -0,0 +1,167 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { assert, it } from "@effect/vitest";
+import {
+ CommandId,
+ EventId,
+ ProjectId,
+ ProviderInstanceId,
+ ThreadId,
+ type OrchestrationEvent,
+} from "@t3tools/contracts";
+import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
+import * as Layer from "effect/Layer";
+import * as Path from "effect/Path";
+​
+import { ServerConfig } from "../../config.ts";
+import { OrchestrationEventStoreLive } from "../../persistence/Layers/OrchestrationEventStore.ts";
+import { SqlitePersistenceMemory } from "../../persistence/Layers/Sqlite.ts";
+import { OrchestrationEventStore } from "../../persistence/Services/OrchestrationEventStore.ts";
+import { ProjectionStateRepository } from "../../persistence/Services/ProjectionState.ts";
+import { OrchestrationProjectionPipeline } from "../Services/ProjectionPipeline.ts";
+import { OrchestrationProjectionPipelineLive } from "./ProjectionPipeline.ts";
+​
+const TestLayer = OrchestrationProjectionPipelineLive.pipe(
+ Layer.provideMerge(OrchestrationEventStoreLive),
+ Layer.provideMerge(ServerConfig.layerTest(process.cwd(), { prefix: "t3-projection-cleanup-" })),
+ Layer.provideMerge(SqlitePersistenceMemory),
+ Layer.provideMerge(NodeServices.layer),
+);
+​