Skip to content

Commit 72880ae

Browse files
taylordowns2000josephjclark
authored andcommitted
updates
1 parent 45d70ce commit 72880ae

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

packages/lightning-mock/src/api-dev.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ const setupDevAPI = (
201201
}) => {
202202
if (evt.runId === runId) {
203203
state.events.removeListener(RUN_COMPLETE, handler);
204-
resolve(evt.payload.final_state);
204+
const { final_dataclip_id, final_state } = evt.payload;
205+
if (final_dataclip_id) {
206+
resolve(state.dataclips?.[final_dataclip_id] ?? null);
207+
} else {
208+
resolve(final_state);
209+
}
205210
}
206211
};
207212
state.events.addListener(RUN_COMPLETE, handler);

packages/lightning-mock/src/api-sockets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ const createSocketAPI = (
393393
) {
394394
const { ref, join_ref, topic } = evt;
395395
const {
396+
final_dataclip_id,
396397
final_state,
397398
reason,
398399
error_type,
@@ -410,7 +411,9 @@ const createSocketAPI = (
410411
if (!state.results[runId]) {
411412
state.results[runId] = { state: null, workerId: 'mock' };
412413
}
413-
if (final_state) {
414+
if (final_dataclip_id) {
415+
state.results[runId].state = state.dataclips?.[final_dataclip_id] ?? null;
416+
} else if (final_state) {
414417
state.results[runId].state = final_state;
415418
}
416419

packages/ws-worker/test/lightning.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@ test.serial(
291291
return new Promise((done) => {
292292
const run = getRun();
293293
lng.onSocketEvent(e.RUN_COMPLETE, run.id, (evt: any) => {
294-
const { final_state } = evt.payload;
295-
t.assert(typeof final_state === 'object');
294+
const { final_dataclip_id, final_state } = evt.payload;
295+
t.assert(
296+
typeof final_dataclip_id === 'string' ||
297+
typeof final_state === 'object'
298+
);
296299
t.pass('run complete event received');
297300
done();
298301
});

0 commit comments

Comments
 (0)