From d22c6f52800673d954840bd447109aeb707c6e8e Mon Sep 17 00:00:00 2001 From: Marcus Grando Date: Thu, 16 Apr 2026 02:09:29 -0300 Subject: [PATCH] fix: prevent user-input activities from leaking into pending approvals projection (#2051) --- .../server/src/orchestration/Layers/ProjectionPipeline.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/server/src/orchestration/Layers/ProjectionPipeline.ts b/apps/server/src/orchestration/Layers/ProjectionPipeline.ts index aa1109a4d1dd5891b7fe7b29f897ece462c23665..d981ae0da627d1cbc48b264cc331cd72ecbce03d 100644 --- a/apps/server/src/orchestration/Layers/ProjectionPipeline.ts +++ b/apps/server/src/orchestration/Layers/ProjectionPipeline.ts @@ -1284,6 +1284,14 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti } return; } + // Only approval-requested activities should create pending-approval + // rows. Other activity kinds that happen to carry a requestId + // (e.g. user-input.requested / user-input.resolved) must not + // pollute this projection — they have their own accounting via + // derivePendingUserInputCountFromActivities. + if (event.payload.activity.kind !== "approval.requested") { + return; + } if (Option.isSome(existingRow) && existingRow.value.status === "resolved") { return; } -- 2.54.0