Skip to content

fix: incorrect updateWithStart signature #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DanielsStugis
Copy link

@DanielsStugis DanielsStugis commented Apr 11, 2025

What was changed

  • Fixed WorkflowClientCallsInterceptor::updateWithStart() signature to match value returned from WorkflowStarter::updateWithStart()
  • Added test case to cover fixed area.

Why?

Because whenever WorkflowClientCallsInterceptor implementation is provided and updateWithStart() is called exception happens.
Example output, from the provided test case, if signature change is reverted

TypeError: Temporal\Tests\Interceptor\InterceptorCallsCounter::updateWithStart(): Return value must be of type Temporal\Client\Update\UpdateHandle, array returned

Checklist

  1. Closes nothing (did not find any related issue)

  2. How was this tested:
    See the added test case

  3. Any docs updates needed?
    No

Copy link

vercel bot commented Apr 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
php ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2025 5:47am

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roxblnfk roxblnfk added the Bug Something isn't working label Apr 11, 2025
Copy link
Collaborator

@roxblnfk roxblnfk left a comment

Choose a reason for hiding this comment

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

Sorry, I didn't notice that my review was in pending status.

@@ -80,7 +80,7 @@ public function signalWithStart(SignalWithStartInput $input, callable $next): Wo
*
* @see WorkflowClientCallsInterceptor::updateWithStart()
*/
public function updateWithStart(UpdateWithStartInput $input, callable $next): UpdateHandle
public function updateWithStart(UpdateWithStartInput $input, callable $next): array
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you replace the array with UpdateWithStartOutput DTO?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, hopefully managed to cover all the relevant places for it.
Also that exception returning makes things messy, considered making separate properties for $handle and $exception, but then we would have nullable values and ugly checks for those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants