Problem
scheduleDispatch stores dispatchDueFlows().finally(...) with no .catch. dispatchDueFlows rethrows on a failing claim/lease step, so the rejection becomes an unhandled promise rejection. Inside dispatchDueFlows, claim/lease calls sit at the top of the loop outside the per-flow try/catch, so a single throwing claim aborts the entire batch.
Location
apps/web/src/lib/flows/scheduler.ts:121-127
Impact
One bad claim skips all other due flows for that cycle and logs as an unhandled rejection rather than being contained.
Suggested fix
Wrap the claim/lease step in its own try/catch (continue on per-claim failure) and add a .catch on the scheduleDispatch promise.
Source: code investigation.
Problem
scheduleDispatchstoresdispatchDueFlows().finally(...)with no.catch.dispatchDueFlowsrethrows on a failing claim/lease step, so the rejection becomes an unhandled promise rejection. InsidedispatchDueFlows, claim/lease calls sit at the top of the loop outside the per-flow try/catch, so a single throwing claim aborts the entire batch.Location
apps/web/src/lib/flows/scheduler.ts:121-127Impact
One bad claim skips all other due flows for that cycle and logs as an unhandled rejection rather than being contained.
Suggested fix
Wrap the claim/lease step in its own try/catch (continue on per-claim failure) and add a
.catchon thescheduleDispatchpromise.Source: code investigation.