Skip to content
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

Try to fix dispatching of "attachmentsloaded"-events, when the document contains no "regular" attachments (PR 8788, 12163 follow-up) #14888

Merged
merged 1 commit into from
May 8, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

This patch can be tested, in the viewer, using the annotation-fileattachment.pdf document from the test-suite.

It seems that the code to delay dispatching of the "attachmentsloaded"-event, when attachmentsCount === 0, is now effectively broken.[1]
Rather than only using an arbitrary timeout, the new code will instead wait for an "annotationlayerrendered"-event and only fallback to using a timeout.


[1] The timing of the annotationLayer-rendering changed slightly in PR #14247, and the old code in PDFAttachmentViewer wasn't good enough to handle that.

…nt contains no "regular" attachments (PR 8788, 12163 follow-up)

*This patch can be tested, in the viewer, using the `annotation-fileattachment.pdf` document from the test-suite.*

It seems that the code to delay dispatching of the "attachmentsloaded"-event, when `attachmentsCount === 0`, is now effectively broken.[1]
Rather than only using an arbitrary timeout, the new code will instead wait for an "annotationlayerrendered"-event and only *fallback* to using a timeout.

---
[1] The timing of the annotationLayer-rendering changed slightly in PR 14247, and the old code in `PDFAttachmentViewer` wasn't good enough to handle that.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented May 8, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/940c7896a8140d2/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 8, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/940c7896a8140d2/output.txt

Total script time: 2.61 mins

Published

@timvandermeij timvandermeij merged commit 753abc3 into mozilla:master May 8, 2022
@timvandermeij
Copy link
Contributor

Thank you for improving this!

@Snuffleupagus Snuffleupagus deleted the attachmentsCount-zero branch May 8, 2022 12:15
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.

None yet

3 participants