Skip to content

Commit

Permalink
Prevent workflows client nilpointer (#583)
Browse files Browse the repository at this point in the history
* bump durabletask dep

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

* workflows client, prevent nilpointer error on convertMetadata

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

---------

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
  • Loading branch information
famarting committed Jun 26, 2024
1 parent dd35c21 commit c417f95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/go-chi/chi/v5 v5.0.12
github.com/golang/mock v1.6.0
github.com/google/uuid v1.6.0
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.33.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/marusama/semaphore/v2 v2.5.0 h1:o/1QJD9DBYOWRnDhPwDVAXQn6mQYD0gZaS1Tpx6DJGM=
github.com/marusama/semaphore/v2 v2.5.0/go.mod h1:z9nMiNUekt/LTpTUQdpp+4sJeYqUGpwMHfW0Z8V8fnQ=
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d h1:CVjystOHucBzKExLHD8E96D4KUNbehP0ozgue/6Tq/Y=
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d/go.mod h1:OSZ4K7SgqBEsaouk3lAVdDzvanIzsdj7angZ0FTeSAU=
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58 h1:+HZ6RzZz6YBfA+Chtn0SnMU2OgY6nafl2sGbZ9FmerY=
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58/go.mod h1:goe2gmMgLptCijMDQ7JsekaR86KjPUG64V9JDXvKBhE=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand Down
9 changes: 9 additions & 0 deletions workflow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func (c *client) FetchWorkflowMetadata(ctx context.Context, id string, opts ...a
return nil, errors.New("no workflow id specified")
}
wfMetadata, err := c.taskHubClient.FetchOrchestrationMetadata(ctx, api.InstanceID(id), opts...)
if err != nil {
return nil, err
}

return convertMetadata(wfMetadata), err
}
Expand All @@ -145,6 +148,9 @@ func (c *client) WaitForWorkflowStart(ctx context.Context, id string, opts ...ap
return nil, errors.New("no workflow id specified")
}
wfMetadata, err := c.taskHubClient.WaitForOrchestrationStart(ctx, api.InstanceID(id), opts...)
if err != nil {
return nil, err
}

return convertMetadata(wfMetadata), err
}
Expand All @@ -155,6 +161,9 @@ func (c *client) WaitForWorkflowCompletion(ctx context.Context, id string, opts
return nil, errors.New("no workflow id specified")
}
wfMetadata, err := c.taskHubClient.WaitForOrchestrationCompletion(ctx, api.InstanceID(id), opts...)
if err != nil {
return nil, err
}

return convertMetadata(wfMetadata), err
}
Expand Down

0 comments on commit c417f95

Please sign in to comment.