Skip to content

Commit aad0b4c

Browse files
committed
types
1 parent b2b7801 commit aad0b4c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/ws-worker/src/api/execute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export function onJobLog(
281281
}
282282

283283
export async function loadDataclip(
284-
context: Pick<Context, 'logger' | 'channel' | 'id'>,
284+
context: Pick<Context, 'logger' | 'channel' | 'id' | 'options'>,
285285
stateId: string
286286
) {
287287
const result = await sendEvent<Uint8Array>(context, GET_DATACLIP, {
@@ -292,7 +292,7 @@ export async function loadDataclip(
292292
}
293293

294294
export async function loadCredential(
295-
context: Pick<Context, 'logger' | 'channel' | 'id'>,
295+
context: Pick<Context, 'logger' | 'channel' | 'id' | 'options'>,
296296
credentialId: string
297297
) {
298298
return sendEvent(context, GET_CREDENTIAL, { id: credentialId });

packages/ws-worker/src/channels/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const joinRunChannel = (
3838
didReceiveOk = true;
3939
logger.success(`connected to ${channelName}`, e);
4040
const run = await sendEvent<GetPlanReply>(
41-
{ channel, logger, id: runId },
41+
{ channel, logger, id: runId, options: {} },
4242
GET_PLAN
4343
);
4444
resolve({ channel, run });

packages/ws-worker/test/util/send-event.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ test.serial('should send a simple event', async (t) => {
3535
id: 'x',
3636
} as any),
3737
logger,
38+
options: {},
3839
};
3940

4041
await sendEvent(context, EVENT_NAME, {});
@@ -55,6 +56,7 @@ test.serial('should send a simple event with return data', async (t) => {
5556
id: 'x',
5657
} as any),
5758
logger,
59+
options: {},
5860
};
5961

6062
const reply = await sendEvent(context, EVENT_NAME, {});
@@ -76,6 +78,7 @@ test.serial('should throw if the event is rejected', async (t) => {
7678
id: 'x',
7779
} as any),
7880
logger,
81+
options: {},
7982
};
8083

8184
await t.throwsAsync(() => sendEvent(context, EVENT_NAME, {}), {
@@ -96,6 +99,7 @@ test.serial('should throw if the event timesout and retry is 1', async (t) => {
9699
id: 'x',
97100
} as any),
98101
logger,
102+
options: {},
99103
};
100104

101105
await t.throwsAsync(() => sendEvent(context, EVENT_NAME, {}), {
@@ -200,6 +204,7 @@ test.serial('should log if the event is rejected', async (t) => {
200204
id: 'x',
201205
} as any),
202206
logger,
207+
options: {},
203208
};
204209

205210
try {
@@ -227,6 +232,7 @@ test.serial('should report to sentry if the event is rejected', async (t) => {
227232
id: 'x',
228233
} as any),
229234
logger,
235+
options: {},
230236
};
231237

232238
try {
@@ -250,6 +256,7 @@ test.serial('should report to sentry if the event timesout', async (t) => {
250256
id: 'x',
251257
} as any),
252258
logger,
259+
options: {},
253260
};
254261

255262
try {

0 commit comments

Comments
 (0)