Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): events stop maintaining the stream sequence index #35023

ClosedVantrongs(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/35023/headopened View on GitHub

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

x
0 of 10 viewed, 10 left
119 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionMaintenance.test.tsModified
View file
@@ -1,3 +1,5 @@
+import * as NodeSqlite from "node:sqlite";
+​
import { assert, it } from "@effect/vitest";
import {
EventId,
@@ -29,6 +31,13 @@
import * as ProjectionStore from "./ProjectionStore.ts";
import * as OrchestrationEventStore from "../persistence/OrchestrationEventStore.ts";
​
+declare module "node:sqlite" {
+ interface StatementSync {
+ // Node 26 has this; @types/node 24 does not declare it yet.
+ stat(counter: "vmStep"): number;
+ }
+}
+​
const database = SqlitePersistence.layerMemory;
const eventStoreProvided = EventStore.layer.pipe(Layer.provideMerge(database));
const projectionStoreProvided = ProjectionStore.layer.pipe(Layer.provideMerge(database));
@@ -383,3 +392,113 @@
}),
).pipe(Effect.provide(layerTest)),
+​
+it.effect(
+ "finds each stream's newest event in steps that do not grow with retained V1 history",
+ () =>
+ Effect.gen(function* () {