-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[3.8] Backport fix for setting cookies #5233
Conversation
Could you please refer to the master's commit with the fix? |
It's this one: 54afac7 Appears to be part of a more substantial change in aiohttp4 (where HTTPException is no longer subclassing Response). This single line I've taken from there is enough to fix the behaviour in v3.7. |
Codecov Report
@@ Coverage Diff @@
## 3.8 #5233 +/- ##
==========================================
+ Coverage 97.53% 97.55% +0.01%
==========================================
Files 44 44
Lines 8844 8818 -26
Branches 1424 1419 -5
==========================================
- Hits 8626 8602 -24
+ Misses 102 101 -1
+ Partials 116 115 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
That test appears to have passed on the previous commit, so I think it's just flaky (given that I only added a CHANGE file in this commit). |
I've added a simplified version of the test in aiohttp-session, which should catch regressions. |
Cool! I'll take a review soon |
…5262) (#5265) Co-authored-by: Gary Wilson Jr <[email protected]>
aiohttp/web_protocol.py
Outdated
@@ -426,6 +426,7 @@ async def _handle_request( | |||
resp = Response( |
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.
I'm sorry but the fix is incorrect.
This line was backported by the incident.
Since in aiohttp 3.x HttpException is derived from Response we should just use it as-is without the creation of intermediate response object.
I believe this line was incorrectly backported by #4771
I apologize for the regression.
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.
No problem, I'll just update this with the reverted code then.
Appears to actually have been this commit, which moved some of the logic into a new _handle_request() method:
29eccad#diff-2126b277e07e3fdd05e7a81da456accf24e5515a46c78c48a79db4eb166043e4L373
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.
Apparently, not so easy. Now getting ServerDisconnectedError in the tests.
Will take a look later in the week, unless you beat me to it.
OK, reverting back to using the exception as the response seems to require moving the exception handler back to the parent function in order to handle the deprecation warning correctly. I think that's working now though. |
Flaky test? Seems odd that the changes would fail on macos only. Also the CI seems to be struggling, it fails to load the test log half of the time I try to look at it. |
+1! Also ran into this issue and reverted aiohttp to 3.6.3 for now. |
Looking back at my previous comments, the current test failure is the same one from earlier, which is just flaky, as it failed on one commit and passed on the next despite only changing documentation. |
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.
The PR is correct but please move your changes into _handle_request
; it reduces the diff between the master and backport branches.
Also, I would freeze 3.7 branch but publish aiohttp 3.8 soon.
Please use 3.8 as the base branch for PR.
maybe change the pr title as well. |
This pull request introduces 2 alerts and fixes 1 when merging eee5eea into 5d1a75e - view on LGTM.com new alerts:
fixed alerts:
|
First time I've seen a failure from lgtm. :P |
Then I see lgtm alerts I usually open "view on LGTM.com" link, analyze it, and close as "I don't care" or "false alarm". |
Thanks! |
I see this fix in master, but this needs to be released on the 3.7 branch, as aiohttp-session is broken without this.
(cherry-picked from 54afac7)