Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/ws-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# ws-worker

## 1.23.1

### Patch Changes

- Even when sending final_dataclip_id, send finalState because it may be used by other consumers

## 1.23.0

### Minor Changes

- 01a05ff: on send complete, only send final_state for multi-leaf output state. For single-leaf runs, reutrn final_dataclip_id

## 1.22.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/ws-worker",
"version": "1.23.0",
"version": "1.23.1",
"description": "A Websocket Worker to connect Lightning to a Runtime Engine",
"main": "dist/index.js",
"type": "module",
Expand Down
3 changes: 1 addition & 2 deletions packages/ws-worker/src/events/run-complete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ export default async function onWorkflowComplete(

const payload: RunCompletePayload = {
timestamp: timeInMicroseconds(event.time),
final_state: result,
...reason,
};

if (isSingleLeaf) {
payload.final_dataclip_id = state.leafDataclipIds[0];
} else {
payload.final_state = result;
}

try {
Expand Down
4 changes: 2 additions & 2 deletions packages/ws-worker/test/events/run-complete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('should send a run:complete event with final_dataclip_id for single leaf',
[RUN_LOG]: () => true,
[RUN_COMPLETE]: (evt) => {
t.is(evt.final_dataclip_id, 'clip-1');
t.falsy(evt.final_state);
t.deepEqual(evt.final_state, result);
t.falsy(evt.time);
},
});
Expand Down Expand Up @@ -293,7 +293,7 @@ test('should send final_dataclip_id for a single-leaf workflow', async (t) => {
await handleRunComplete(context, event);

t.is(completeEvent.final_dataclip_id, 'abc-123');
t.falsy(completeEvent.final_state);
t.deepEqual(completeEvent.final_state, finalResult);
t.is(completeEvent.reason, 'success');
});

Expand Down