Skip to content

Include transfers correctly in the "GetOperatorList" message (PR 16588 follow-up)#20734

Merged
Snuffleupagus merged 1 commit intomozilla:masterfrom
Snuffleupagus:GetOperatorList-fix-transfers
Feb 26, 2026
Merged

Include transfers correctly in the "GetOperatorList" message (PR 16588 follow-up)#20734
Snuffleupagus merged 1 commit intomozilla:masterfrom
Snuffleupagus:GetOperatorList-fix-transfers

Conversation

@Snuffleupagus
Copy link
Collaborator

Currently the transfers aren't actually being used with the "GetOperatorList" message, since the placement of the parameter is wrong; note the method signature:

/**
* Sends a message to the comObj to invoke the action with the supplied data.
* Expect that the other side will callback to signal 'start_complete'.
* @param {string} actionName - Action to call.
* @param {JSON} data - JSON data to send.
* @param {Object} queueingStrategy - Strategy to signal backpressure based on
* internal queue.
* @param {Array} [transfers] - List of transfers/ArrayBuffers.
* @returns {ReadableStream} ReadableStream to read data in chunks.
*/
sendWithStream(actionName, data, queueingStrategy, transfers) {
This goes back to PR #16588, which added the transfers parameter, and unfortunately we all missed that :-(

Simply fixing the parameter isn't enough however, since that broke printing of Stamp-editors (and possibly others). The solution here is to not transfer data during printing, given that a single PrintAnnotationStorage instance is being used for all pages.

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.76%. Comparing base (3c43414) to head (82fc2c9).

Files with missing lines Patch % Lines
src/display/annotation_storage.js 80.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #20734   +/-   ##
=======================================
  Coverage   62.76%   62.76%           
=======================================
  Files         169      169           
  Lines      119838   119845    +7     
=======================================
+ Hits        75211    75225   +14     
+ Misses      44627    44620    -7     
Flag Coverage Δ
fonttest 7.66% <ø> (ø)
unittestcli 62.74% <81.81%> (+<0.01%) ⬆️

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.

…8 follow-up)

Currently the transfers aren't actually being used with the "GetOperatorList" message, since the placement of the parameter is wrong; note the method signature: https://github.com/mozilla/pdf.js/blob/909a700afa004167bb05bc3d67ed113e74a71729/src/shared/message_handler.js#L219-L229
This goes back to PR 16588, which added the transfers parameter, and unfortunately we all missed that :-(

Simply fixing the parameter isn't enough however, since that broke printing of Stamp-editors (and possibly others). The solution here is to *not* transfer data during printing, given that a single `PrintAnnotationStorage` instance is being used for all pages.
@Snuffleupagus Snuffleupagus force-pushed the GetOperatorList-fix-transfers branch from 979d37b to 82fc2c9 Compare February 25, 2026 14:55
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux test

@moz-tools-bot
Copy link
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/4320b18b323fa6c/output.txt

@Snuffleupagus
Copy link
Collaborator Author

/botio-windows test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/89c11748a815dfd/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/4320b18b323fa6c/output.txt

Total script time: 60.00 mins

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/89c11748a815dfd/output.txt

Total script time: 85.44 mins

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

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

@Snuffleupagus Snuffleupagus marked this pull request as ready for review February 25, 2026 17:47
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit 17a4d2e into mozilla:master Feb 26, 2026
12 checks passed
@Snuffleupagus Snuffleupagus deleted the GetOperatorList-fix-transfers branch February 26, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants