From ac4aad8294571a5d1ed9112193a5915aa360ea6f Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Fri, 10 Jul 2026 13:24:34 +0400 Subject: [PATCH] fix(client): generate update id client-side when not provided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WorkflowStub::startUpdate() sent an empty update id and relied on the Temporal frontend to assign one. The frontend does; the Java time-skipping test server does not — the empty id reaches the worker, which panics ("update id is empty, can't validate update"), failing the update workflow task in a retry loop and wedging the whole execution. The update result never returns and subsequent signals stop being processed (issue #577). Generate the id client-side via Common\Uuid::v4() when the caller did not supply one, matching sdk-go, sdk-java and sdk-typescript. Adds a functional regression test that runs an update against the time-skipping test server (WithoutTimeSkipping). Closes #577 --- src/Internal/Client/WorkflowStub.php | 2 +- .../UpdateOnTimeSkippingServerTestCase.php | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Functional/Client/UpdateOnTimeSkippingServerTestCase.php diff --git a/src/Internal/Client/WorkflowStub.php b/src/Internal/Client/WorkflowStub.php index 2e35657b..2f257c7d 100644 --- a/src/Internal/Client/WorkflowStub.php +++ b/src/Internal/Client/WorkflowStub.php @@ -330,7 +330,7 @@ static function ( arguments: EncodedValues::fromValues($args, $this->converter), header: Header::empty(), waitPolicy: $nameOrOptions->waitPolicy, - updateId: $nameOrOptions->updateId ?? '', + updateId: $nameOrOptions->updateId ?? Uuid::v4(), firstExecutionRunId: $nameOrOptions->firstExecutionRunId ?? '', resultType: $nameOrOptions->resultType, )); diff --git a/tests/Functional/Client/UpdateOnTimeSkippingServerTestCase.php b/tests/Functional/Client/UpdateOnTimeSkippingServerTestCase.php new file mode 100644 index 00000000..842dbc00 --- /dev/null +++ b/tests/Functional/Client/UpdateOnTimeSkippingServerTestCase.php @@ -0,0 +1,41 @@ +createClient(); + $workflow = $client->newWorkflowStub(UpdateWorkflow::class); + + $client->start($workflow); + + /** @see UpdateWorkflow::addNameWithoutValidation */ + $result = $workflow->__getUntypedStub() + ->startUpdate('addNameWithoutValidation', 'Test') + ->getResult(5); + + self::assertSame('Hello, Test!', $result); + + $workflow->exit(); + } +}