Skip to content

Commit 6ffb42d

Browse files
authored
fix timeout events status (#695)
* fix timeout events status * add it to test
1 parent a4b986f commit 6ffb42d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/utils/data-formatters/schema/history-event-schema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ const externalExecutionInfoSchema = z.object({
184184
const historyEventBaseSchema = z.object({
185185
eventId: z.string(),
186186
eventTime: timestampSchema.nullable(),
187-
version: z.string(),
187+
// version is recieved as a numeric value if it is 0
188+
// this is unexpected behavior from grpc protoLoader
189+
// coerce the value to string to avoid the issue
190+
version: z.coerce.string(),
188191
taskId: z.string(),
189192
});
190193

src/views/workflow-page/helpers/__tests__/get-workflow-is-completed.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('getWorkflowIsCompleted', () => {
99
'workflowExecutionContinuedAsNewEventAttributes',
1010
'workflowExecutionFailedEventAttributes',
1111
'workflowExecutionTerminatedEventAttributes',
12+
'workflowExecutionTimedOutEventAttributes',
1213
];
1314

1415
it('should return true for attributes in the workflowCompletedAttributes list', () => {

src/views/workflow-page/helpers/get-workflow-is-completed.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const workflowCompletedAttributes = [
2626
'workflowExecutionContinuedAsNewEventAttributes',
2727
'workflowExecutionFailedEventAttributes',
2828
'workflowExecutionTerminatedEventAttributes',
29+
'workflowExecutionTimedOutEventAttributes',
2930
];
3031

3132
const getWorkflowIsCompleted = (lastEventAttributes: string) =>

0 commit comments

Comments
 (0)