Skip to content

Sync v2 fails if an edge is invalid #1354

@josephjclark

Description

@josephjclark

I've just hit a weird use-case where I'm getting an error processing this edge:

{
  edge: {
    id: '93b9c964-027a-4407-8e68-e79659dd0ead',
    target_job_id: undefined,
    enabled: true,
    source_trigger_id: 'e4e67da6-65f8-49eb-99df-460d9ca77176',
    condition_type: 'always'
  }
}

It looks like I've managed to get a workflow locally with an invalid edge lost inside it? Weird. And probably a lightning bug.

Bit the CLI shouldn't die in this case

[CLI] ✘ TypeError: Cannot read properties of undefined (reading 'name')
    at file:///home/joe/repo/openfn/kit/packages/project/dist/index.js:282:57
    at Array.map (<anonymous>)
    at generateHash (file:///home/joe/repo/openfn/kit/packages/project/dist/index.js:276:46)
    at Workflow.getVersionHash (file:///home/joe/repo/openfn/kit/packages/project/dist/index.js:465:12)
    at findLocallyChangedWorkflows (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:2253:35)
    at handler3 (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3359:27)
    at async handler4 (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3438:3)
    at async parse (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3991:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Tech Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions