Skip to content

Prevent "Uncaught promise" messages in the console when cancelling (some) ReadableStreams #13822

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

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 30, 2021

While fixing issue #13794, I noticed that cancelling the ReadableStream returned by the PDFPageProxy.streamTextContent-method could lead to "Uncaught promise" messages in the console.[1]
Generally speaking, we don't really care about errors when cancelling a ReadableStream and it thus seems reasonable to simply suppress any output in those cases.


[1] Although, after that issue was fixed you'd now need to set the API-option stopAtErrors = true to actually trigger this.

…ome) `ReadableStream`s

While fixing issue 13794, I noticed that cancelling the `ReadableStream` returned by the `PDFPageProxy.streamTextContent`-method could lead to "Uncaught promise" messages in the console.[1]
Generally speaking, we don't really care about errors when *cancelling* a `ReadableStream` and it thus seems reasonable to simply suppress any output in those cases.

---
[1] Although, after that issue was fixed you'd now need to set the API-option `stopAtErrors = true` to actually trigger this.
@Snuffleupagus Snuffleupagus force-pushed the ReadableStreams-cancel-no-Uncaught_promise branch from b47a480 to 1df9da9 Compare July 30, 2021 12:27
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/c51ac4ccb135bb4/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/7121490b864d13a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c51ac4ccb135bb4/output.txt

Total script time: 33.22 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 9
  different first/second rendering: 1

Image differences available at: http://54.67.70.0:8877/c51ac4ccb135bb4/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/7121490b864d13a/output.txt

Total script time: 38.88 mins

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

Image differences available at: http://3.101.106.178:8877/7121490b864d13a/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 67f4c34 into mozilla:master Jul 30, 2021
@timvandermeij
Copy link
Contributor

Thank you for improving this!

@Snuffleupagus Snuffleupagus deleted the ReadableStreams-cancel-no-Uncaught_promise branch July 30, 2021 20:23
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.

3 participants