Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): superseded node, message and turn-item snapshots no longer pile up #19451

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

Showing 11 changed files with 4 additions and 0 deletions (loading 10).

x
0 of 11 viewed, 11 left
4 additions and 0 deletionsapps/server/src/orchestration-v2/EventSink.tsModified
View file
@@ -30,6 +30,7 @@
import * as CommandReceiptStore from "./CommandReceiptStore.ts";
import * as EffectOutbox from "./EffectOutbox.ts";
import * as EventStore from "./EventStore.ts";
+import { retireSupersededSnapshots } from "./EventSnapshotRetirement.ts";
import * as ProjectionStore from "./ProjectionStore.ts";
import * as ProjectStore from "./ProjectStore.ts";
import * as TurnItemPositionStore from "./TurnItemPositionStore.ts";
@@ -351,6 +352,9 @@
yield* Effect.forEach(storedEvents, (stored) => projectionStore.apply(stored.event), {
concurrency: 1,
});
+ yield* retireSupersededSnapshots(storedEvents).pipe(
+ Effect.provideService(SqlClient.SqlClient, sql),
+ );
const sequence = storedEvents.at(-1)?.sequence;
if (sequence !== undefined) {
const now = DateTime.formatIso(yield* DateTime.now);
apps/server/src/orchestration-v2/EventSnapshotRetirement.test.tsAdded
View file
Loading the diff
apps/server/src/orchestration-v2/EventSnapshotRetirement.tsAdded
View file
Loading the diff
apps/server/src/orchestration-v2/FoundationPersistence.test.tsModified
View file
Loading the diff