Skip to content

Compile errors step name#1313

Merged
josephjclark merged 3 commits intorelease/nextfrom
compile-errors-step-name
Mar 17, 2026
Merged

Compile errors step name#1313
josephjclark merged 3 commits intorelease/nextfrom
compile-errors-step-name

Conversation

@josephjclark
Copy link
Collaborator

Short Description

When reporting compilation errors, include the step name, not the step UUID.

Fixes #1308

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation bot moved this to New Issues in Core Mar 17, 2026
@josephjclark josephjclark changed the base branch from main to release/next March 17, 2026 16:40
@josephjclark josephjclark merged commit 32b43cb into release/next Mar 17, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from New Issues to Done in Core Mar 17, 2026
@josephjclark josephjclark deleted the compile-errors-step-name branch March 17, 2026 16:40
josephjclark added a commit that referenced this pull request Mar 17, 2026
* Fix worker crash caused by async promise antipattern and event ordering (#1311)

* fix(ws-worker): remove async promise antipattern in run-log.ts

The non-batch log path wrapped an async function in `new Promise(async
(resolve) => { ... })`. If sendEvent rejected (e.g. channel timeout),
the outer Promise never settled and the rejection was unhandled. This
was the direct cause of the worker crash: LightningTimeoutError on
run:log became an uncaught exception that killed the container.

The function is already async so the wrapper was unnecessary — replaced
with a plain for-loop that properly propagates rejections.

* fix(ws-worker): remove async promise antipattern in try-with-backoff.ts

Same `new Promise(async ...)` antipattern as run-log.ts. If the
isCancelled callback or any other code in the catch block threw, the
error became an unhandled rejection instead of propagating to the
caller.

Replaced with an inner async function that returns its promise
directly. setTimeout retry replaced with awaited promise to keep the
flow async-native.

* fix(ws-worker): remove async promise antipattern in destroy.ts

Same `new Promise(async (resolve) => { ... })` pattern — if
engine.destroy() or waitForRunsAndClaims rejected, the outer promise
never settled. Replaced with an async IIFE so errors propagate through
Promise.all to the caller.

* fix(engine-multi): emit compilation log before workflow-error

During a compilation failure, engine-multi emitted WORKFLOW_ERROR
(from the worker:error handler) before the "Error occurred during
compilation" WORKFLOW_LOG (from the .catch handler). The ws-worker
tears down the channel on WORKFLOW_ERROR, so the subsequent log push
had nowhere to go — triggering the LightningTimeoutError that crashed
the container.

Moved the compilation log into the worker:error handler so it emits
before the error event. Guarded the .catch handler's log with
!didError to avoid duplication. Added COMPILE_START/COMPLETE events
to mock-run.ts to match real worker behavior.

* chore: add changesets for worker crash fixes

* chore: exclude engine-multi tmp from pnpm workspace

Test fixture directories under packages/engine-multi/tmp/ were being
picked up as workspace packages by the packages/** glob, pulling in
phantom dependencies (ava@6.x and its full transitive tree) that
caused persistent lockfile churn.

* remove duplicate log, tidy types

* update changelogs

* tidy test

* revert diff on destroy

* keep destroy change after all and fix test

* relax runtime test

it just went flaky

---------

Co-authored-by: Joe Clark <jclark@openfn.org>

* Compile errors step name (#1313)

* engine: report compile errors with step name, not id

* changeset

* remove debug code

* Lazy state errors (#1312)

* compiler: improve error messages for lazy state

* compiler: report position on lazy state reporting

* update extra errors

* update changeset

* types

* versions

---------

Co-authored-by: Stuart Corbishley <corbish@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Compile errors in lightning use the step UUID, not name

2 participants