Skip to content

Commit 4fbe5a4

Browse files
authored
fix(activity): Add missing Activity Info fields (#1187)
1 parent c1e7fff commit 4fbe5a4

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

packages/activity/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export interface Info {
164164
* Timeout for this Activity from start to close in milliseconds
165165
*/
166166
startToCloseTimeoutMs: number;
167+
/**
168+
* Timestamp for when the current attempt of this Activity was scheduled in milliseconds
169+
*/
170+
currentAttemptScheduledTimestampMs: number;
167171
/**
168172
* Heartbeat timeout in milliseconds.
169173
* If this timeout is defined, the Activity must heartbeat before the timeout is reached.

packages/testing/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,15 @@ export const defaultActivityInfo: activity.Info = {
376376
activityType: 'unknown',
377377
workflowType: 'test',
378378
base64TaskToken: Buffer.from('test').toString('base64'),
379+
heartbeatTimeoutMs: undefined,
379380
heartbeatDetails: undefined,
380381
activityNamespace: 'default',
381382
workflowNamespace: 'default',
382383
workflowExecution: { workflowId: 'test', runId: 'dead-beef' },
383384
scheduledTimestampMs: 1,
384385
startToCloseTimeoutMs: 1000,
385386
scheduleToCloseTimeoutMs: 1000,
387+
currentAttemptScheduledTimestampMs: 1,
386388
};
387389

388390
/**

packages/worker/src/worker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,11 +1828,13 @@ async function extractActivityInfo(
18281828
isLocal: start.isLocal,
18291829
activityType: start.activityType,
18301830
workflowType: start.workflowType,
1831+
heartbeatTimeoutMs: start.heartbeatTimeout ? tsToMs(start.heartbeatTimeout) : undefined,
18311832
heartbeatDetails: await decodeFromPayloadsAtIndex(dataConverter, 0, start.heartbeatDetails),
18321833
activityNamespace,
18331834
workflowNamespace: start.workflowNamespace,
18341835
scheduledTimestampMs: tsToMs(start.scheduledTime),
18351836
startToCloseTimeoutMs: tsToMs(start.startToCloseTimeout),
18361837
scheduleToCloseTimeoutMs: tsToMs(start.scheduleToCloseTimeout),
1838+
currentAttemptScheduledTimestampMs: tsToMs(start.currentAttemptScheduledTime),
18371839
};
18381840
}

0 commit comments

Comments
 (0)