-
Notifications
You must be signed in to change notification settings - Fork 21
Fix issue where aiohttp.ClientResponse data wasn't being awaited on #197
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
base: main
Are you sure you want to change the base?
Conversation
…uring HTTP exception handling
The committers listed above are authorized under a signed CLA. |
@extreme4all and @demetere let me know if I missed something. This functionality is super important to handle http statuses correctly. |
@cmbernard333 The two-line change itself is indeed straightforward, but the main challenge I've been facing is writing a test case that captures the issue. Right now, the tests pass both with and without the change, which suggests we're missing coverage for that edge case. I'm currently digging into the existing tests to understand what's already covered and where a new test would best fit to reflect the problem we're addressing. That's why I haven’t opened a PR just yet. |
Interesting. I can consistently make it fail, prior to any changes, by passing bad data to the /check api when using it in asynchronous mode in my own code. Let me see if I can’t pull a test together. |
After reviewing the tests in the repo, and unless I'm missing something entirely, there doesn't appear to be a good way to test this inside the repo itself since everything appears to be mocked. I can repeatedly reproduce this with the openfga python-sdk talking to a local openfga instance just by passing bad data to Any proposal here on testing it properly is appreciated. |
@demetere one more note: the failure is reproducible most when using async, hence the need to check for |
I know I am being annoying. Its annoying this occurs constantly for me in my testing. It is definitely not an edge case when running with async. I can easily reproduce it with the SDK via the following:
Then it produces this stack trace
|
Sadly I do not have any leads on that, that was the sole reason for not opening PR from my side, Let ask the opinion of maintainers |
Is there any update on this one? |
Hi all. Thanks @cmbernard333 and @demetere for really digging into this issue. During our backlog review this week, we can assign someone to help and get more eyes on this. |
Fixes issue #184 where aiohttp.ClientResponse data wasn't being awaited on. Credit to @extreme4all and @demetere for doing the actual investigation work here.
Description
Added awaiting for the response data inside of the exception handler so that it is safe to read the response status.
References
Review Checklist
main