| ... | @@ -1284,6 +1284,14 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti | ... | @@ -1284,6 +1284,14 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti |
| 1284 | } | 1284 | } |
| 1285 | return; | 1285 | return; |
| 1286 | } | 1286 | } |
| | 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 | } |
| 1287 | if (Option.isSome(existingRow) && existingRow.value.status === "resolved") { | 1295 | if (Option.isSome(existingRow) && existingRow.value.status === "resolved") { |
| 1288 | return; | 1296 | return; |
| 1289 | } | 1297 | } |