Skip to content

Commit 54abb1f

Browse files
authored
refactor(client)!: Remove Long (#818)
1 parent a883260 commit 54abb1f

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

package-lock.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@temporalio/internal-non-workflow-common": "file:../internal-non-workflow-common",
1919
"@temporalio/internal-workflow-common": "file:../internal-workflow-common",
2020
"@temporalio/proto": "file:../proto",
21-
"@types/long": "^4.0.2",
2221
"ms": "^2.1.3",
2322
"protobufjs": "^7.0.0",
2423
"uuid": "^8.3.2"

packages/client/src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { SearchAttributes } from '@temporalio/internal-workflow-common';
22
import { temporal } from '@temporalio/proto';
33
import type * as grpc from '@grpc/grpc-js';
4-
import type Long from 'long';
54

65
export interface WorkflowExecution {
76
workflowId: string;
@@ -31,7 +30,7 @@ export interface WorkflowExecutionDescription {
3130
runId: string;
3231
taskQueue: string;
3332
status: { code: temporal.api.enums.v1.WorkflowExecutionStatus; name: WorkflowExecutionStatusName };
34-
historyLength: Long;
33+
historyLength: number;
3534
startTime: Date;
3635
executionTime?: Date;
3736
closeTime?: Date;

packages/client/src/workflow-client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,9 @@ export class WorkflowClient {
853853
code: raw.workflowExecutionInfo!.status!,
854854
name: workflowStatusCodeToName(raw.workflowExecutionInfo!.status!),
855855
},
856-
historyLength: raw.workflowExecutionInfo!.historyLength!,
856+
// Safe to convert to number
857+
// Max history length is 50k, which is much less than Number.MAX_SAFE_INTEGER
858+
historyLength: raw.workflowExecutionInfo!.historyLength!.toNumber(),
857859
startTime: tsToDate(raw.workflowExecutionInfo!.startTime!),
858860
executionTime: optionalTsToDate(raw.workflowExecutionInfo!.executionTime),
859861
closeTime: optionalTsToDate(raw.workflowExecutionInfo!.closeTime),

0 commit comments

Comments
 (0)