Skip to content

fix: Consume Response object on Error #98

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 1 commit into
base: main
Choose a base branch
from

Conversation

andydexter
Copy link

@andydexter andydexter commented May 26, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Details of the bug have been described in #65.

When using Deno to test edge functions, Response bodies with status codes not matching 2xx are not consumed before the invoke function returns with the FunctionError object, causing a leak.
This is detrimental for testing edge functions as all tests that expect errors fail due to the leak.

What is the new behavior?

Response bodies are cancelled before returning, closing the response and mitigating the leak.

Resolves #65

@andydexter andydexter changed the title Consume Response object on Error fix: Consume Response object on Error May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative tests for edge functions with Deno
1 participant