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
{{ message }}
Repository navigation
project: pull crashes when step names with no ASCII characters slugify to the same empty id #1603
Related to #1602 (workflow names slugifying to the same id). This issue is the same problem at the step level.
Problem
openfn project pull fails with:
✘ Error: Edge references unknown target "5440d66f-d77d-4abe-8bc1-749c15850f3b". seems a node's id changed without edges connecting to it being updated.
at generateHash
at Workflow.getVersionHash
at Workflow.canMergeInto
at _Project.canMergeInto
at hasUntrackedChanges
Seen in the GitHub sync action (openfn/cli-pull-action@v2) against a staging project. The workflows Flujo de atención al ciudadano and Q3/Q4 "Data-Sync" Workflow (v2.0) … each contain two steps named 患者確認 and فحص المريض.
Cause
On pull, from-app-state.ts sets each step id to slugify(step.name).
slugify replaces \W, which matches every character outside [A-Za-z0-9_]. A name with no ASCII characters becomes "", and accented names lose letters (atención → atenci-n).
Both steps end up with id: '', and nothing checks for duplicate ids.
In mapWorkflow, both the step-id→uuid lookup and wfState.jobs use the step id as the key. The two steps overwrite each other, and because one map follows file order and the other is sorted by name, a different step wins in each. An edge then references a uuid that isn't in jobs, and generateHash throws.
The first pull of such a project doesn't crash, because it doesn't hash the tracked project, but it writes both steps' expressions to the same workflows/<wf>/.js, so one step's code is lost. The next pull loads the tracked project in hasUntrackedChanges and crashes.
Repro
Create a workflow in Lightning with two steps named 患者確認 and فحص المريض, then run openfn project pull twice.
Suggested fix
Make slugify keep Unicode letters and digits, e.g. /[^\p{L}\p{N}_]/gu. This changes the ids for existing accented names, so folders and files for those workflows would be renamed.
Activity