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: page.pdf producing an invalid pdf #7868

Merged
merged 4 commits into from Jan 26, 2022
Merged

fix: page.pdf producing an invalid pdf #7868

merged 4 commits into from Jan 26, 2022

Conversation

tjacobs3
Copy link
Contributor

@tjacobs3 tjacobs3 commented Dec 22, 2021

What kind of change does this PR introduce?
Bugfix

Summary
When defining a chunk size for <CDPSession>.send('IO.read', { handle, size }), the CDPSession will occassionally indicate that it has reached the end of file without sending a full pdf. This is documented by the associated issue.

This behavior is not reproducible when leaving out the size parameter. Since the size parameter is not required on the CDPSession side and is merely a suggestion on the stream side, we can safely leave it out.

Refs: #7757

Does this PR introduce a breaking change?
No

When defining a chunk size for <CDPSession>.send('IO.read', { handle, size }), the CDPSession will occassionally indicate an that it has reached the end of file without sending a full pdf. This is documented by the associated issue.

This behavior is not reproducable when leaving out the size parameter. Since the size parameter is not required on the CDPSession side and is merely a suggestion on the stream side, we can safely leave it out.

Refs: puppeteer#7757
@OrKoN
Copy link
Collaborator

OrKoN commented Jan 24, 2022

Thanks for the fix. I'd really appreciate if you add a failing test case that is fixed by this.

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 26, 2022

Disregard my previous comment, I think we can land it without new test cases. Could you please add a TODO like TODO: bring the size parameter back once Chromium issue crbug.com/1290727 is resolved.

@OrKoN OrKoN enabled auto-merge (squash) January 26, 2022 12:02
@OrKoN
Copy link
Collaborator

OrKoN commented Jan 26, 2022

I will add a TODO myself in a follow-up PR.

@OrKoN OrKoN merged commit afea509 into puppeteer:main Jan 26, 2022
@MartinFalatic
Copy link

@OrKoN Thank you for expediting this, and for tracking down a potential root cause in Chromium itself!

@tjacobs3 Thanks for the effective workaround to keep puppeteer working properly while we await the fix in Chromium!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants