Skip to content

Convert the data reading in getPdfManager to be asynchronous#20662

Merged
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:getPdfManager-async-read
Mar 7, 2026
Merged

Convert the data reading in getPdfManager to be asynchronous#20662
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:getPdfManager-async-read

Conversation

@Snuffleupagus
Copy link
Copy Markdown
Collaborator

This is not only shorter, but (in my opinion) it also simplifies the code.

Note: In order to keep the five different BasePDFStreamReader implementations consistent, we purposely don't re-factor the PDFWorkerStreamReader class to support for await...of iteration.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 89.83051% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.79%. Comparing base (a4fcd83) to head (7f4e29e).

Files with missing lines Patch % Lines
src/core/worker.js 89.83% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20662      +/-   ##
==========================================
+ Coverage   62.75%   62.79%   +0.03%     
==========================================
  Files         169      169              
  Lines      119829   119824       -5     
==========================================
+ Hits        75199    75241      +42     
+ Misses      44630    44583      -47     
Flag Coverage Δ
fonttest 7.67% <ø> (ø)
unittestcli 62.76% <89.83%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus Snuffleupagus force-pushed the getPdfManager-async-read branch 2 times, most recently from 2002f09 to ebd195a Compare March 1, 2026 20:41
This is not only shorter, but (in my opinion) it also simplifies the code.

*Note:* In order to keep the *five* different `BasePDFStreamReader` implementations consistent, we purposely don't re-factor the `PDFWorkerStreamReader` class to support `for await...of` iteration.
@Snuffleupagus Snuffleupagus force-pushed the getPdfManager-async-read branch from ebd195a to e8ab3cb Compare March 6, 2026 10:13
@Snuffleupagus
Copy link
Copy Markdown
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/092fd98032852ee/output.txt

@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/9a0f8599c2d3cac/output.txt

@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/092fd98032852ee/output.txt

Total script time: 43.97 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/092fd98032852ee/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus marked this pull request as ready for review March 6, 2026 11:36
@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/9a0f8599c2d3cac/output.txt

Total script time: 71.95 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/9a0f8599c2d3cac/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit d34a15e into mozilla:master Mar 7, 2026
12 checks passed
@timvandermeij
Copy link
Copy Markdown
Contributor

Thank you for refactoring this code!

@Snuffleupagus Snuffleupagus deleted the getPdfManager-async-read branch March 7, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants