-
Notifications
You must be signed in to change notification settings - Fork 432
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
Custom handlers to support trigger return values #8874
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some inline comments to explain my changes.
else | ||
{ | ||
// Some triggers (like Durable Functions' triggers) assign $return implicitly. | ||
scriptInvocationResult.Return = httpScriptInvocationResult.ReturnValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior to this change, return values were only saved when there was an explicit $return
binding declared in function.json. Durable Functions triggers, however, do not use explicit $return
bindings. Instead, the $return
binding is implicit in the trigger implementation, thus the return value wasn't being returned by this logic.
I couldn't think of any meaningful reason why return values should be ignored when there's no $return
binding in function.json, so I added this else
case to unblock Durable Functions, and any other trigger that might also have implicit return value bindings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good. Would be good to have some validation/tests for this scenario as well.
Looks like my change broke one of the unit tests, so I'll need to go ahead and make test changes anyways for this. |
I noticed that the All unit tests are passing. |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
I do think Is there anything else you need from us to help you get this PR merged? I think from our side there are some open comments that need to be addressed and release note conflicts - otherwise happy to take to review again and help get approvals in place |
Thanks @liliankasem! I updated the release notes file and merged with the latest from |
I think you're all clear! |
Thanks @liliankasem! I'll go ahead and merge it then. |
@horihiro yes, I think it will solve that issue as well! |
Issue describing the changes in this PR
The current custom handlers implementation doesn't send trigger return values back to the extension. Trigger return value support is required for Durable Functions SDKs to work correctly in a custom handler worker.
More specific comments on the changes can be found in the code comments.
Pull request checklist
release_notes.md
Example app
Here's an example Go app that was used to test this new functionality. The middleware.go source code is the part that implements the custom handler protocol needed by Durable Functions.
main.go
middleware.go