Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Interceptor/WorkflowInbound/QueryInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Temporal\Interceptor\WorkflowInbound;

use Temporal\DataConverter\ValuesInterface;
use Temporal\Workflow\WorkflowInfo;

/**
* @psalm-immutable
Expand All @@ -25,14 +26,17 @@ class QueryInput
public function __construct(
public readonly string $queryName,
public readonly ValuesInterface $arguments,
public readonly WorkflowInfo $info,
) {}

public function with(
ValuesInterface $arguments = null,
?ValuesInterface $arguments = null,
?workflowInfo $info = null,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roxblnfk 👀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will be improved with the next PR

): self {
return new self(
$this->queryName,
$arguments ?? $this->arguments,
$info ?? $this->info,
);
}
}
2 changes: 2 additions & 0 deletions src/Interceptor/WorkflowInbound/SignalInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(
public readonly WorkflowInfo $info,
public readonly ValuesInterface $arguments,
public readonly HeaderInterface $header,
public readonly bool $isReplaying,
) {}

public function with(
Expand All @@ -43,6 +44,7 @@ public function with(
$info ?? $this->info,
$arguments ?? $this->arguments,
$header ?? $this->header,
$this->isReplaying,
);
}
}
2 changes: 2 additions & 0 deletions src/Interceptor/WorkflowInbound/UpdateInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __construct(
public readonly WorkflowInfo $info,
public readonly ValuesInterface $arguments,
public readonly HeaderInterface $header,
public readonly bool $isReplaying,
) {}

public function with(
Expand All @@ -45,6 +46,7 @@ public function with(
$info ?? $this->info,
$arguments ?? $this->arguments,
$header ?? $this->header,
$this->isReplaying,
);
}
}
2 changes: 2 additions & 0 deletions src/Interceptor/WorkflowInbound/WorkflowInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct(
public readonly WorkflowInfo $info,
public readonly ValuesInterface $arguments,
public readonly HeaderInterface $header,
public readonly bool $isReplaying,
) {}

public function with(
Expand All @@ -39,6 +40,7 @@ public function with(
$info ?? $this->info,
$arguments ?? $this->arguments,
$header ?? $this->header,
$this->isReplaying,
);
}
}
2 changes: 1 addition & 1 deletion src/Internal/Transport/Router/InvokeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static function () use ($name, $request, $resolver, $handler, $context, $headers
/** @psalm-suppress InaccessibleProperty */
$info->shouldContinueAsNew = $tickInfo->continueAsNewSuggested;

$result = $handler(new QueryInput($name, $request->getPayloads()));
$result = $handler(new QueryInput($name, $request->getPayloads(), $info));
$resolver->resolve(EncodedValues::fromValues([$result]));
} catch (\Throwable $e) {
$resolver->reject($e);
Expand Down
1 change: 1 addition & 0 deletions src/Internal/Transport/Router/InvokeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred
info: $context->getInfo(),
arguments: $request->getPayloads(),
header: $request->getHeader(),
isReplaying: $context->isReplaying(),
);

// Validation
Expand Down
7 changes: 6 additions & 1 deletion src/Internal/Transport/Router/StartWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred
/** @see WorkflowInboundCallsInterceptor::execute() */
'execute',
)(
new WorkflowInput($context->getInfo(), $context->getInput(), $context->getHeader()),
new WorkflowInput(
$context->getInfo(),
$context->getInput(),
$context->getHeader(),
$context->isReplaying(),
),
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Internal/Workflow/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function (?\Throwable $error): void {
$this->scopeContext->getInfo(),
$arguments,
$this->scopeContext->getHeader(),
$this->scopeContext->isReplaying(),
));
},
);
Expand Down