You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BatchQueue rushes through every item before the loop finishes its
26
-
seal step, the callback fires (setting `processingCompletedAt`),
27
-
`cleanup()` deletes the Redis metadata, then the service's
28
-
`getBatchEnqueuedCount` returns 0 ≠ `runCount`. The count-mismatch
29
-
branch returned `sealed:false` because `sealed=false + PENDING`
30
-
wasn't distinguishable from "client should stream more items". The
31
-
SDK then retried the stream against the cleaned-up batch, the
32
-
engine threw `Batch not found or not initialized`, retries
33
-
exhausted, customer saw `BatchTriggerError` despite every child run
34
-
completing successfully.
35
-
36
-
The pre-loop check, the count-mismatch handler, and the seal-failed
37
-
handler now all call a single `isIdempotentRetrySuccess(status, sealed,
38
-
processingCompletedAt)` helper. `processingCompletedAt` is the
39
-
discriminator that fixes mode (3) — it's set exclusively by the V2
40
-
completion callback, so `(status=PENDING) && (sealed || processingCompletedAt
41
-
!= null)` cleanly separates "callback fired, work is done" from "client
42
-
should stream more items".
43
-
44
-
`ABORTED` (zero TaskRun records — every run-creation attempt failed
45
-
*and* the pre-failed-TaskRun fallback also failed) is explicitly
46
-
excluded from the idempotent-success path in all three branches: the
47
-
customer has nothing to monitor at the run level, so the trigger call
48
-
must throw to give their `batchTrigger()` retry the chance to create a
49
-
fresh batch.
6
+
Stop spurious `BatchTriggerError` failures when a fast-completing `batchTrigger`/`batchTriggerAndWait` raced the stream finalisation - the API now treats these as successes instead of 422s.
0 commit comments