Replicate official SDK to fetch results from Temporal#305
Open
abhishekjain16 wants to merge 3 commits intocoinbase:masterfrom
Open
Replicate official SDK to fetch results from Temporal#305abhishekjain16 wants to merge 3 commits intocoinbase:masterfrom
abhishekjain16 wants to merge 3 commits intocoinbase:masterfrom
Conversation
bdchauvette
reviewed
Jul 11, 2024
|
@bdchauvette We are also getting this error now, is it possible to merge this fix? It's causing us a bit of headache |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While running long workflows that require synchronous results,
await_workflow_resultthrows the following exception:pointing to line https://github.com/coinbase/temporal-ruby/blob/master/lib/temporal/client.rb#L251
Reason:
When trying to fetch workflow execution history with
event_type: :close, Temporal sends empty events payload after next event (not necessarily close event)Calling
.first.typefails on empty event.Fix:
Follow what official SDK does in Go and TS. Create a loop and try and fetch close event till it can find one
TS Example:
https://github.com/temporalio/sdk-typescript/blob/913e67e6381c421c3ed02ee24518adfa1243c84c/packages/client/src/workflow-client.ts#L630
Go Example:
https://github.com/temporalio/sdk-go/blob/626785769094562b39662d6076304c807b596ed9/internal/internal_workflow_client.go#L433-L436
This PR tries to replicate the same behavior