Improve error handling in the PDFFindController.prototype.#extractText method#21197
Merged
calixteman merged 2 commits intoApr 30, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21197 +/- ##
==========================================
- Coverage 55.94% 55.89% -0.06%
==========================================
Files 218 218
Lines 59062 59066 +4
==========================================
- Hits 33043 33014 -29
- Misses 26019 26052 +33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…xt` method This handles *all* errors correctly, if e.g. the document is closed in the middle of searching. Also, replacing the "promise chains" with more `await` helps simplify the code a little bit.
…troller.prototype.#extractText` method Given that all of the relevant API methods are asynchronous it's possible, although quite unlikely, that the existing "is the document active" check won't catch all situations where the document was closed in the middle of searching.
7216dda to
aa08b02
Compare
Contributor
|
Thank you for helping out with this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve error handling in the
PDFFindController.prototype.#extractTextmethodThis handles all errors correctly, if e.g. the document is closed in the middle of searching.
Also, replacing the "promise chains" with more
awaithelps simplify the code a little bit.Avoid setting page-content for a previous document in the
PDFFindController.prototype.#extractTextmethodGiven that all of the relevant API methods are asynchronous it's possible, although quite unlikely, that the existing "is the document active" check won't catch all situations where the document was closed in the middle of searching.