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

version 3.6.0 breaks Electron 80 (Chromium 80) #922

Closed
hans2520 opened this issue Feb 23, 2021 · 4 comments
Closed

version 3.6.0 breaks Electron 80 (Chromium 80) #922

hans2520 opened this issue Feb 23, 2021 · 4 comments

Comments

@hans2520
Copy link

Verified that POST request works prior to upgrading to whatwg-fetech 3.6.0. Behavior the same with 3.6.1. Afterwards, with no other changes, we can see server receive Content-Length of 0 and empty body.

I found the offending line of code, simply commenting it out fixes things:
5c6b055#r47472637

The branch system above is quite convoluted, but I think if you can ensure the original body is preserved when you assign here, things will still work. From what I can tell, my code was hitting the final branch (5c6b055#diff-3fc6f1265a180d15035618e36ca1da88d092bacb4fc10a423938fa62e4f5f58fR246) and body being re-assigned there. But I tried a simple case of removing the body assignment there, and using body as the assignment instead on line 262, but it doesn't work. Making a new variable var origBody = body at the top of the branches and assigning that on line 262 does work however.

So probably want to look at cleaning up those branches. In the meantime, will be stuck at v3.5

@JakeChampion
Copy link
Owner

Could you please post a small piece of code which would reproduce the problem you are seeing? With a small example, I should be able to help fix this issue. Without one, I will struggle a lot.

@hans2520
Copy link
Author

Well the issue seems to be with this line of code (line 246) because we are modifying the contents of body & _bodyText: 5c6b055#diff-3fc6f1265a180d15035618e36ca1da88d092bacb4fc10a423938fa62e4f5f58fR246

Then you are saying you are going to "save" the original body content into _bodyInit, but by this time it isn't true that body & _bodyText have the original contents. In fact it seems that in my case, the original contents of _bodyInit were already correct, and what's being assigned in line 246 is in fact wiping body and _bodyInit out entirely and that's why an empty body is sent to the server with this change.

SImply making this assignment on line 227 (
5c6b055#diff-3fc6f1265a180d15035618e36ca1da88d092bacb4fc10a423938fa62e4f5f58fR227), a new line:

var origBody = body

Then changing line 262 (5c6b055#diff-3fc6f1265a180d15035618e36ca1da88d092bacb4fc10a423938fa62e4f5f58fR262) to

 this._bodyInit = origBody

Also fixes the issue.

However, that is very much a hack for what is a very convoluted conditional branch tree that really should just be re-worked altogether. There's too much leaky logic going on in there.

@JakeChampion
Copy link
Owner

@saifalislam
Copy link

What are this things ??

Repository owner locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants