Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): drop pending approvals when a thread reverts #8425

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

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

x
0 of 2 viewed, 2 left
204 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsModified
View file
@@ -2626,6 +2626,210 @@
+​
+ it.effect("drops later-turn pending approvals when a thread is reverted", () =>
+ Effect.gen(function* () {
+ const projectionPipeline = yield* OrchestrationProjectionPipeline;
+ const eventStore = yield* OrchestrationEventStore;
+ const sql = yield* SqlClient.SqlClient;
+ const appendAndProject = (event: Parameters<typeof eventStore.append>[0]) =>
+ eventStore
+ .append(event)
+ .pipe(Effect.flatMap((savedEvent) => projectionPipeline.projectEvent(savedEvent)));
+​
+ yield* appendAndProject({
+ type: "project.created",
+ eventId: EventId.make("evt-revert-approval-1"),
+ aggregateKind: "project",
+ aggregateId: ProjectId.make("project-revert-approval"),
+ occurredAt: "2026-02-26T13:00:00.000Z",
+ commandId: CommandId.make("cmd-revert-approval-1"),
+ causationEventId: null,
+ correlationId: CorrelationId.make("cmd-revert-approval-1"),
+ metadata: {},
+ payload: {
+ projectId: ProjectId.make("project-revert-approval"),
+ title: "Project Revert Approval",
+ workspaceRoot: "/tmp/project-revert-approval",
+ defaultModelSelection: null,