Skip to content

Commit

Permalink
Fix issue when a workflow stub without defined Type runs an update me…
Browse files Browse the repository at this point in the history
…thod (#547)
  • Loading branch information
roxblnfk authored Jan 7, 2025
1 parent 6598397 commit bf33938
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 0 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@
<code><![CDATA[$attr->getFailure()]]></code>
<code><![CDATA[$attr->getResult()]]></code>
<code><![CDATA[$input->workflowType]]></code>
<code><![CDATA[$input->workflowType]]></code>
<code><![CDATA[$result->getQueryResult()]]></code>
<code><![CDATA[$this->execution]]></code>
<code><![CDATA[$this->execution]]></code>
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Client/ResponseToResultMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
public function mapUpdateWorkflowResponse(
UpdateWorkflowExecutionResponse $result,
string $updateName,
string $workflowType,
?string $workflowType,
WorkflowExecution $workflowExecution,
): StartUpdateOutput {
$outcome = $result->getOutcome();
Expand Down
13 changes: 13 additions & 0 deletions tests/Acceptance/Extra/Update/UntypedStubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ public function fetchResultWithTimeout(
$this->assertSame(['key' => null], (array)$result, 'Workflow result contains resolved value');
}

#[Test]
public function useClientRunningWorkflowStub(
#[Stub('Extra_Update_UntypedStub')] WorkflowStubInterface $stub,
WorkflowClientInterface $client,
): void {
$untyped = $client->newUntypedRunningWorkflowStub(
$stub->getExecution()->getID(),
$stub->getExecution()->getRunID(),
);

$this->fetchResolvedResultAfterWorkflowCompleted($untyped);
}

#[Test]
public function handleUnknownUpdate(
#[Stub('Extra_Update_UntypedStub')] WorkflowStubInterface $stub,
Expand Down

0 comments on commit bf33938

Please sign in to comment.