-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Ensure that the response-origin of range requests match the full request (issue 12744) #19028
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
8b48921
to
b407dbb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b407dbb
to
9c38dd5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
9c38dd5
to
84a81f2
Compare
2703c6d
to
a04f057
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/b74c2a0c1d65210/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/a250d0ad1d48219/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/a250d0ad1d48219/output.txt Total script time: 30.73 mins
Image differences available at: http://54.241.84.105:8877/a250d0ad1d48219/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/b74c2a0c1d65210/output.txt Total script time: 46.16 mins
|
Thank you!
Hopefully that's fixed now, by using a similar pattern of waiting for the headers as in |
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.
The functional behavior of the patch looks good to me. I added a comment below with a suggestion to simplify, basically getting rid of the new _readCapability
promise in favor of rejecting existing request promises. Consider this patch approved and ready to merge with that suggestion applied.
A note to a comment in the PR text / commit message:
Note: The relevant unit-tests are updated to await the headersReady Promise before dispatching range requests, since that's consistent with the actual usage in the src/-folder.
Note: this test fixup was needed because this patch introduces a new requirement: getRangeReader
can only be invoked on streams that were preceded by a full request, at least until the point that the headers were received. Independently of whether the current code satisfies that requirement, we should document this expectation.
I confirmed your claim that the current code in src/
awaits headersReady
before dispatching range requests, with the entry point being at getPdfManager
in worker.js - our implementation does this because in order to know whether we need to switch to range requests, we first need to know whether the server supports range requests. Currently the only supported way to do so is to send another request.
As an example of a differing implementation: the Chrome extension has already received the headers at the time that the viewer is opened, so in theory it could forward the headers and response origin to the viewer so that it can immediately try switch to range requests faster (without doing the initial full request). I currently have no plans to implement that in the Chrome extension due to added complexity though.
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
…est (issue 12744) The following cases are excluded in the patch: - The Firefox PDF Viewer, since it has been fixed on the platform side already; please see https://bugzilla.mozilla.org/show_bug.cgi?id=1683940 - The `PDFNodeStream`-implementation, used in Node.js environments, since after recent changes that code only supports `file://`-URLs. Also updates the `PDFNetworkStreamFullRequestReader.read`-method to await the headers before returning any data, similar to the implementation in `src/display/fetch_stream.js`. *Note:* The relevant unit-tests are updated to await the `headersReady` Promise before dispatching range requests, since that's consistent with the actual usage in the `src/`-folder.
a04f057
to
6a01558
Compare
Fixed, thank you.
I've added a comment in
So basically, the Chrome extension could be changed to instead use |
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/401c70deab6d163/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/06175bf9956bd84/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/401c70deab6d163/output.txt Total script time: 2.59 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/06175bf9956bd84/output.txt Total script time: 6.81 mins
|
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
Regression tests for issue mozilla#12744 and PR mozilla#19028
The following cases are excluded in the patch:
The Firefox PDF Viewer, since it has been fixed on the platform side already; please see https://bugzilla.mozilla.org/show_bug.cgi?id=1683940
The
PDFNodeStream
-implementation, used in Node.js environments, since after recent changes that code only supportsfile://
-URLs.Also updates the
read
-methods, on bothPDFNetworkStreamFullRequestReader
andPDFNetworkStreamRangeRequestReader
, to await the headers before returning any data similarly to the implementation insrc/display/fetch_stream.js
.Note: The relevant unit-tests are updated to await the
headersReady
Promise before dispatching range requests, since that's consistent with the actual usage in thesrc/
-folder.Fixes #12744