Improve the cleanup functionality for thumbnails #12616
Merged
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.
This is a pre-existing issue that I noticed while working on PR #12613, and fixing this also brings the thumbnail code inline with the page code.
Given the intermittent nature of all of this, it's somewhat difficult to reproduce it consistently; however the following steps should at least provide an outline:
PDFViewerApplication.cleanup()
in the console.What intermittently happens here is that
WorkerTransport.startCleanup
rejects, and consequently that cleanup doesn't complete as intended, since some of the thumbnails are left in a pending renderingState[1].Fixing this is simple though, and only requires updating
PDFThumbnailViewer.cleanup
along the lines ofBaseViewer.cleanup
.[1] Keep in mind that thumbnails will only render when the thumbnailView is visible, to reduce resource usage.