temporalio / sdk-go

Temporal Go SDK
https://docs.temporal.io/application-development?lang=go
MIT License
529 stars 210 forks source link

Workflow Update in Test Environment should dedup updates by ID #1638

Open Quinn-With-Two-Ns opened 1 month ago

Quinn-With-Two-Ns commented 1 month ago

Expected Behavior

Workflow Updates in Test Environment behave like Updates against a real server and either dupes for fails if an update with a duplicate ID is sent

Actual Behavior

Test Environment accepts update with duplicate ID

yuandrew commented 1 week ago

Is the ID here referring to UpdateID from the UpdateClientWorkflow options? I'm working through some other failures in setting up this workflow, want to double check I'm going down the right path.

Quinn-With-Two-Ns commented 1 week ago

Is the ID here referring to UpdateID from the UpdateClientWorkflow options

Conceptually yes, but the test environment does not use a client since it is all in memory in the same process

Here is an example of sending an update with the test environment https://github.com/temporalio/samples-go/blob/main/reqrespupdate/workflow_test.go#L41, here "test id" is the UpdateID

yuandrew commented 1 week ago

I'm playing around with the update go sample, and when I add UpdateID: we.GetID() to the UpdateWorkflowOptions, I'm not seeing the real server throw any error. Shouldn't this update fail?

Quinn-With-Two-Ns commented 1 week ago

Shouldn't this update fail?

No, the real server will dedup the update request by the update ID