Skip to content

Commit d22c6f5

Browse files
authored
fix: prevent user-input activities from leaking into pending approvals projection (#2051)
1 parent 5e13f53 commit d22c6f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/server/src/orchestration/Layers/ProjectionPipeline.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,14 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti
12841284
}
12851285
return;
12861286
}
1287+
// Only approval-requested activities should create pending-approval
1288+
// rows. Other activity kinds that happen to carry a requestId
1289+
// (e.g. user-input.requested / user-input.resolved) must not
1290+
// pollute this projection — they have their own accounting via
1291+
// derivePendingUserInputCountFromActivities.
1292+
if (event.payload.activity.kind !== "approval.requested") {
1293+
return;
1294+
}
12871295
if (Option.isSome(existingRow) && existingRow.value.status === "resolved") {
12881296
return;
12891297
}

0 commit comments

Comments
 (0)