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

fix: session.getBlobData never resolves with blob sizes > 65536 #35277

Merged
merged 4 commits into from Sep 7, 2022

Conversation

frank-pian
Copy link
Contributor

@frank-pian frank-pian commented Aug 9, 2022

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

Release Notes

Notes: Fix session.getBlobData never resolves with blob sizes > 65536

@welcome
Copy link

welcome bot commented Aug 9, 2022

💖 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:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

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.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 9, 2022
@frank-pian
Copy link
Contributor Author

@VerteDinde It seems to work

@codebytere codebytere changed the title fix: session.getBlobData never resolves with blob sizes > 65536 (#34398) fix: session.getBlobData never resolves with blob sizes > 65536 Aug 9, 2022
Copy link
Member

@codebytere codebytere left a 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.

@frank-pian
Copy link
Contributor Author

@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.
This PR submission process is confusing to me. I hope you can help me complete the test. I just want to fix this bug.
Thanks!

@zcbenz zcbenz added semver/patch backwards-compatible bug fixes target/19-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Aug 15, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 15, 2022
Copy link
Member

@zcbenz zcbenz left a 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.

@frank-pian
Copy link
Contributor Author

@zcbenz
Yes, I have verified the code using this case and it works.

Copy link
Contributor

@jkleinsc jkleinsc left a 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.

@microwugui
Copy link

microwugui commented Aug 22, 2022

@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
Why not create a new PR by yourself to fix this issue and provide the test cases/docs you are supposed to provide?

@frank-pian
Copy link
Contributor Author

@jkleinsc ok, i have added test case.

@frank-pian frank-pian requested review from jkleinsc and removed request for codebytere August 22, 2022 06:18
Copy link
Member

@zcbenz zcbenz left a 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?

@frank-pian
Copy link
Contributor Author

Can you rebase to fix the merge conflict?

I merged main branch. Are there any other mistakes?

@zcbenz
Copy link
Member

zcbenz commented Aug 25, 2022

/cc @codebytere @jkleinsc

@RangerMauve
Copy link

This would be very useful to have, running into some issues with uploading files to protocol handlers. 😅

@jkleinsc jkleinsc merged commit e3efa16 into electron:main Sep 7, 2022
@welcome
Copy link

welcome bot commented Sep 7, 2022

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Sep 7, 2022

Release Notes Persisted

Fix session.getBlobData never resolves with blob sizes > 65536

trop bot pushed a commit that referenced this pull request Sep 7, 2022
* 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>
trop bot pushed a commit that referenced this pull request Sep 7, 2022
* 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>
trop bot pushed a commit that referenced this pull request Sep 7, 2022
* 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>
@trop
Copy link
Contributor

trop bot commented Sep 7, 2022

I have automatically backported this PR to "19-x-y", please check out #35600

@trop
Copy link
Contributor

trop bot commented Sep 7, 2022

I have automatically backported this PR to "20-x-y", please check out #35601

@trop trop bot added the in-flight/20-x-y label Sep 7, 2022
@trop
Copy link
Contributor

trop bot commented Sep 7, 2022

I have automatically backported this PR to "21-x-y", please check out #35602

@trop trop bot added in-flight/21-x-y and removed target/20-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Sep 7, 2022
Pink021 added a commit to Pink021/electron that referenced this pull request Sep 8, 2022
codebytere pushed a commit that referenced this pull request Sep 8, 2022
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>
@trop trop bot added merged/21-x-y PR was merged to the "21-x-y" branch. and removed in-flight/21-x-y labels Sep 8, 2022
jkleinsc added a commit that referenced this pull request Sep 8, 2022
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>
@trop trop bot added the merged/20-x-y label Sep 8, 2022
jkleinsc added a commit that referenced this pull request Sep 8, 2022
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>
@trop trop bot removed the in-flight/20-x-y label Sep 8, 2022
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/21-x-y PR was merged to the "21-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: session.getBlobData never resolves with blob sizes > 65536
6 participants