Skip to content

Commit 425b2b0

Browse files
authored
fix(client): Handle test server empty history when waiting for workflow result (#902)
1 parent 3728364 commit 425b2b0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/client/src/workflow-client.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,9 @@ export class WorkflowClient {
502502
} catch (err) {
503503
this.rethrowGrpcError(err, { workflowId, runId }, 'Failed to get Workflow execution history');
504504
}
505-
if (!res.history) {
506-
throw new Error('No history returned by service');
507-
}
508-
const { events } = res.history;
509-
if (!events) {
510-
throw new Error('No events in history returned by service');
511-
}
512-
if (events.length === 0) {
505+
const events = res.history?.events;
506+
507+
if (events == null || events.length === 0) {
513508
req.nextPageToken = res.nextPageToken;
514509
continue;
515510
}

0 commit comments

Comments
 (0)