@openfn/ws-worker 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -4
- package/dist/start.js +9 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ type RunState = {
|
|
|
18
18
|
// For each run, map the input ids
|
|
19
19
|
// TODO better name maybe?
|
|
20
20
|
inputDataclips: Record<string, string>;
|
|
21
|
+
// If for any reason a dataclip was not sent to lightning, track it
|
|
22
|
+
withheldDataclips: Record<string, true>;
|
|
21
23
|
reasons: Record<string, ExitReason>;
|
|
22
24
|
|
|
23
25
|
// final dataclip id
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var name, version, description, main, type, scripts, bin, author, license, depen
|
|
|
29
29
|
var init_package = __esm({
|
|
30
30
|
"package.json"() {
|
|
31
31
|
name = "@openfn/ws-worker";
|
|
32
|
-
version = "1.6.
|
|
32
|
+
version = "1.6.4";
|
|
33
33
|
description = "A Websocket Worker to connect Lightning to a Runtime Engine";
|
|
34
34
|
main = "dist/index.js";
|
|
35
35
|
type = "module";
|
|
@@ -456,6 +456,7 @@ var create_run_state_default = (plan, input) => {
|
|
|
456
456
|
lastDataclipId: "",
|
|
457
457
|
dataclips: {},
|
|
458
458
|
inputDataclips: {},
|
|
459
|
+
withheldDataclips: {},
|
|
459
460
|
reasons: {},
|
|
460
461
|
plan,
|
|
461
462
|
input
|
|
@@ -660,6 +661,7 @@ async function onStepComplete(context, event, error) {
|
|
|
660
661
|
}
|
|
661
662
|
evt.output_dataclip_id = dataclipId;
|
|
662
663
|
} catch (e) {
|
|
664
|
+
state.withheldDataclips[dataclipId] = true;
|
|
663
665
|
evt.output_dataclip_error = "DATACLIP_TOO_LARGE";
|
|
664
666
|
const time = (timestamp2() - BigInt(1e7)).toString();
|
|
665
667
|
await onJobLog(context, {
|
|
@@ -684,12 +686,15 @@ async function onStepStart(context, event) {
|
|
|
684
686
|
state.activeStep = crypto4.randomUUID();
|
|
685
687
|
state.activeJob = event.jobId;
|
|
686
688
|
const input_dataclip_id = state.inputDataclips[event.jobId];
|
|
687
|
-
|
|
689
|
+
const evt = {
|
|
688
690
|
step_id: state.activeStep,
|
|
689
691
|
job_id: state.activeJob,
|
|
690
|
-
input_dataclip_id,
|
|
691
692
|
timestamp: timeInMicroseconds(event.time)
|
|
692
|
-
}
|
|
693
|
+
};
|
|
694
|
+
if (!state.withheldDataclips[input_dataclip_id]) {
|
|
695
|
+
evt.input_dataclip_id = input_dataclip_id;
|
|
696
|
+
}
|
|
697
|
+
await sendEvent(channel, STEP_START, evt);
|
|
693
698
|
}
|
|
694
699
|
|
|
695
700
|
// src/util/log-final-reason.ts
|
package/dist/start.js
CHANGED
|
@@ -37,7 +37,7 @@ var name, version, description, main, type, scripts, bin, author, license, depen
|
|
|
37
37
|
var init_package = __esm({
|
|
38
38
|
"package.json"() {
|
|
39
39
|
name = "@openfn/ws-worker";
|
|
40
|
-
version = "1.6.
|
|
40
|
+
version = "1.6.4";
|
|
41
41
|
description = "A Websocket Worker to connect Lightning to a Runtime Engine";
|
|
42
42
|
main = "dist/index.js";
|
|
43
43
|
type = "module";
|
|
@@ -595,6 +595,7 @@ var create_run_state_default = (plan, input) => {
|
|
|
595
595
|
lastDataclipId: "",
|
|
596
596
|
dataclips: {},
|
|
597
597
|
inputDataclips: {},
|
|
598
|
+
withheldDataclips: {},
|
|
598
599
|
reasons: {},
|
|
599
600
|
plan,
|
|
600
601
|
input
|
|
@@ -799,6 +800,7 @@ async function onStepComplete(context, event, error) {
|
|
|
799
800
|
}
|
|
800
801
|
evt.output_dataclip_id = dataclipId;
|
|
801
802
|
} catch (e) {
|
|
803
|
+
state.withheldDataclips[dataclipId] = true;
|
|
802
804
|
evt.output_dataclip_error = "DATACLIP_TOO_LARGE";
|
|
803
805
|
const time = (timestamp2() - BigInt(1e7)).toString();
|
|
804
806
|
await onJobLog(context, {
|
|
@@ -823,12 +825,15 @@ async function onStepStart(context, event) {
|
|
|
823
825
|
state.activeStep = crypto5.randomUUID();
|
|
824
826
|
state.activeJob = event.jobId;
|
|
825
827
|
const input_dataclip_id = state.inputDataclips[event.jobId];
|
|
826
|
-
|
|
828
|
+
const evt = {
|
|
827
829
|
step_id: state.activeStep,
|
|
828
830
|
job_id: state.activeJob,
|
|
829
|
-
input_dataclip_id,
|
|
830
831
|
timestamp: timeInMicroseconds(event.time)
|
|
831
|
-
}
|
|
832
|
+
};
|
|
833
|
+
if (!state.withheldDataclips[input_dataclip_id]) {
|
|
834
|
+
evt.input_dataclip_id = input_dataclip_id;
|
|
835
|
+
}
|
|
836
|
+
await sendEvent(channel, STEP_START, evt);
|
|
832
837
|
}
|
|
833
838
|
|
|
834
839
|
// src/util/log-final-reason.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/ws-worker",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "A Websocket Worker to connect Lightning to a Runtime Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"ws": "^8.18.0",
|
|
25
25
|
"@openfn/engine-multi": "1.2.4",
|
|
26
26
|
"@openfn/lexicon": "^1.1.0",
|
|
27
|
-
"@openfn/
|
|
28
|
-
"@openfn/
|
|
27
|
+
"@openfn/runtime": "1.4.2",
|
|
28
|
+
"@openfn/logger": "1.0.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/koa": "^2.13.5",
|