Skip to content

Commit bf33938

Browse files
authored
Fix issue when a workflow stub without defined Type runs an update method (#547)
1 parent 6598397 commit bf33938

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

psalm-baseline.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@
428428
<code><![CDATA[$attr->getFailure()]]></code>
429429
<code><![CDATA[$attr->getResult()]]></code>
430430
<code><![CDATA[$input->workflowType]]></code>
431-
<code><![CDATA[$input->workflowType]]></code>
432431
<code><![CDATA[$result->getQueryResult()]]></code>
433432
<code><![CDATA[$this->execution]]></code>
434433
<code><![CDATA[$this->execution]]></code>

src/Internal/Client/ResponseToResultMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
public function mapUpdateWorkflowResponse(
2626
UpdateWorkflowExecutionResponse $result,
2727
string $updateName,
28-
string $workflowType,
28+
?string $workflowType,
2929
WorkflowExecution $workflowExecution,
3030
): StartUpdateOutput {
3131
$outcome = $result->getOutcome();

tests/Acceptance/Extra/Update/UntypedStubTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ public function fetchResultWithTimeout(
6868
$this->assertSame(['key' => null], (array)$result, 'Workflow result contains resolved value');
6969
}
7070

71+
#[Test]
72+
public function useClientRunningWorkflowStub(
73+
#[Stub('Extra_Update_UntypedStub')] WorkflowStubInterface $stub,
74+
WorkflowClientInterface $client,
75+
): void {
76+
$untyped = $client->newUntypedRunningWorkflowStub(
77+
$stub->getExecution()->getID(),
78+
$stub->getExecution()->getRunID(),
79+
);
80+
81+
$this->fetchResolvedResultAfterWorkflowCompleted($untyped);
82+
}
83+
7184
#[Test]
7285
public function handleUnknownUpdate(
7386
#[Stub('Extra_Update_UntypedStub')] WorkflowStubInterface $stub,

0 commit comments

Comments
 (0)