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
fix: session.getBlobData never resolves with blob sizes > 65536 #35277
Conversation
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
@VerteDinde It seems to work |
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.
@frank-pian please fill out the PR body and describe your changes in enough detail for them to be appropriately reviewed. Release notes are also required. Can this be tested? If yes, we should add a test to prevent regressions.
OK, I'll try to complete the information. |
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 good with this change since it is a trivial one and matches the behavior of Chromium's code:
https://source.chromium.org/chromium/chromium/src/+/main:services/network/data_pipe_element_reader.cc;drc=aeedf4cd0d323c89781ecbe6662c899cdfa8aa81;l=112?q=OnHandleReadable&ss=chromium
But a test is still preferred since there is already a test case written in https://gist.github.com/quantatic/b3b9955084b145c77987e4dbc6c81078.
@zcbenz |
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.
@frank-pian can you add a test here https://github.com/electron/electron/blob/main/spec-main/api-session-spec.ts#L485 using the gist https://gist.github.com/quantatic/b3b9955084b145c77987e4dbc6c81078? You can copy what was done for the existing session.getBlobData
test and just modify to test this fix.
I think it's not frank's business |
@jkleinsc ok, i have added test case. |
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.
Can you rebase to fix the merge conflict?
I merged main branch. Are there any other mistakes? |
/cc @codebytere @jkleinsc |
This would be very useful to have, running into some issues with uploading files to protocol handlers. 😅 |
Congrats on merging your first pull request! 🎉🎉🎉 |
Release Notes Persisted
|
* fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
I have automatically backported this PR to "19-x-y", please check out #35600 |
I have automatically backported this PR to "20-x-y", please check out #35601 |
I have automatically backported this PR to "21-x-y", please check out #35602 |
…36 (electron#35277)" This reverts commit e3efa16.
fix: session.getBlobData never resolves with blob sizes > 65536 (#35277) * fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Frank Pian <bianyongfang@vip.qq.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
fix: session.getBlobData never resolves with blob sizes > 65536 (#35277) * fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Frank Pian <bianyongfang@vip.qq.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
fix: session.getBlobData never resolves with blob sizes > 65536 (#35277) * fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Frank Pian <bianyongfang@vip.qq.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
…tron#35277) * fix: session.getBlobData never resolves with blob sizes > 65536 (electron#34398) * Add unit test case for session.getBlobData Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Description of Change
Fixes #34398
When the blob data is greater than 65536 in length, remaining_size_ != 0.
My understanding of the Electron code is superficial, but it is feasible after testing.
Checklist
npm test
passesRelease Notes
Notes: Fix session.getBlobData never resolves with blob sizes > 65536