Skip to content
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

Skip serialization of http result when it is stored in an output binding #2896

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

satvu
Copy link
Member

@satvu satvu commented Dec 11, 2024

Issue describing the changes in this PR

resolves #2682, cannot be merged until Azure/azure-functions-host#10698 is released.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@@ -85,6 +85,9 @@ private static async Task<bool> TryHandleHttpResult(object? result, FunctionCont
// processing is required.
context.GetInvocationResult().Value = null;
break;
case AspNetCoreHttpResponseData when !isInvocationResult:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should test for the base class - HttpResponseData instead? In theory, I could see a customer adding a middleware which will replace/wrap that input binding with their own. We would still want this to work in that case.

Now I am unsure if that scenario is possible with todays extension points. But unless we absolutely need the type to be exactly AspNetCoreHttpResponseData, it is typically better to work off the base class.

Copy link
Member Author

Choose a reason for hiding this comment

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

The above case for the invocation result also uses the more specific type (AspNetCoreHttpResponseData). The reasoning is captured here in another code review. I also had the same thought originally.

@satvu satvu requested a review from jviau December 17, 2024 19:08
@satvu satvu marked this pull request as ready for review December 19, 2024 22:16
@satvu satvu added the blocked Items that cannot move forward at the moment. label Dec 19, 2024
@@ -170,6 +170,24 @@ public async Task InvocationResultNull_WhenResultIsTypeAspNetCoreHttpResponseDat
test.MockCoordinator.Verify(p => p.CompleteFunctionInvocation(It.IsAny<string>()), Times.Once());
}

[Fact]
public async Task HttpResultOutputBindingNull_WhenUsingAspNetCoreHttpResponseDataInMultiOutputBinding()
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems like tests in this file have a blocker (see here)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Items that cannot move forward at the moment.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IFeatureCollection has been disposed exception during http trigger
2 participants