Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): bound thread catch-up replay and stop full-DB snapshot hydration #5147

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5147/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 152 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
3 additions and 1 deletionapps/server/src/cli/project.tsModified
View file
@@ -337,7 +337,9 @@
​
const getOfflineSnapshot = Effect.fn("getOfflineSnapshot")(function* () {
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
- return yield* projectionSnapshotQuery.getSnapshot();
+ // Project commands only read the project list, so use the lightweight
+ // command read model instead of hydrating every thread body in the database.
+ return yield* projectionSnapshotQuery.getCommandReadModel();
});
​
const tryResolveLiveProjectExecutionMode = Effect.fn("tryResolveLiveProjectExecutionMode")(
6 additions and 1 deletionapps/server/src/orchestration/http.tsModified
View file
@@ -32,8 +32,13 @@
Effect.fn("environment.orchestration.snapshot")(function* (args) {
yield* annotateEnvironmentRequest(args.endpoint.name);
yield* requireEnvironmentScope(AuthOrchestrationReadScope);
+ // Serve the lightweight command read model (thread bodies empty)
+ // instead of the fully hydrated snapshot. Hydrating every message
+ // and activity payload in the database has OOM-killed servers, and
+ // the route's only consumer (the project CLI) reads projects alone —
+ // UI clients load the shell and per-thread snapshots instead.
return yield* projectionSnapshotQuery
- .getSnapshot()
+ .getCommandReadModel()
.pipe(
Effect.catch((cause) =>
failEnvironmentInternal("orchestration_snapshot_failed", cause),