Skip to content

[HN-053] Flow scheduler dispatch not error-isolated per flow #462

Description

@Inakitajes

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendÁrea: Backend/APIbugSomething isn't workingreliabilityReliability / data integrityseverity:lowLow severity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions