Skip to content

[Bug]: Integration test must update an existing annotation and show the right popup permafails #20237

@timvandermeij

Description

@timvandermeij

Attach (recommended) or Link to PDF file

N/A

Web browser and its version

Firefox 142.0.1

Operating system and its version

Arch Linux

PDF.js version

master (the regressing commit is not released yet)

Is the bug present in the latest PDF.js version?

No

Is a browser extension

No

Steps to reproduce the problem

  1. Run only the must update an existing annotation and show the right popup on master using e.g. fit.
  2. Observe that it permafails with the following traceback (both locally and on the bots):
1) FreeText Editor FreeText (update existing and popups) must update an existing annotation and show the right popup
  Message:
�[31m    Error: Waiting for selector `.annotationEditorLayer:not(.freetextEditing)` failed�[0m
  Stack:
    error properties: Object({ cause: Error: Waiting failed })
        at CSSQueryHandler.waitFor (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.js:211:46)
        at async BidiFrame.waitForSelector (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:545:21)
        at async BidiPage.waitForSelector (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:1378:20)
        at async switchToEditor (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/test_utils.mjs:811:3)
        at async file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/freetext_editor_spec.mjs:995:11
        at async Promise.all (index 0)
        at async UserContext.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/freetext_editor_spec.mjs:967:7)
    Caused by: Error: Waiting failed
    error properties: Object({ cause: ProtocolError: script.callFunction timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed. })
        at <instance_members_initializer> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:21:21)
        at new WaitTask (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:27:16)
        at BidiFrameRealm.waitForFunction (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/api/Realm.js:22:26)
        at CSSQueryHandler.waitFor (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.js:176:95)
        at async BidiFrame.waitForSelector (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:545:21)
        at async BidiPage.waitForSelector (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:1378:20)
        at async switchToEditor (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/test_utils.mjs:811:3)
        at async file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/freetext_editor_spec.mjs:995:11
        at async Promise.all (index 0)
        at async UserContext.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/test/integration/freetext_editor_spec.mjs:967:7)
    Caused by: ProtocolError: script.callFunction timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
        at <instance_members_initializer> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:98:14)
        at new Callback (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:102:16)
        at CallbackRegistry.create (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:21:26)
        at BidiConnection.send (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/bidi/Connection.js:53:32)
        at Session.send (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/bidi/core/Session.js:134:42)
        at Session.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/util/decorators.js:101:27)
        at WindowRealm.callFunction (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/bidi/core/Realm.js:92:51)
        at WindowRealm.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/util/decorators.js:101:27)
        at #evaluate (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/bidi/Realm.js:134:42)
        at BidiFrameRealm.evaluateHandle (file:///C:/pdfjs/botio-files-pdfjs/private/5207d5074caddeb/node_modules/puppeteer-core/lib/esm/puppeteer/bidi/Realm.js:101:36)

The problem occurs when disabling freetext editing mode. The following traceback is visible in the browser console when this happens:

Uncaught (in promise) TypeError: can't access property "dir", this[#contentsObj] is null
    render http://127.0.0.1:43971/build/generic/build/pdf.mjs:17205
    #show http://127.0.0.1:43971/build/generic/build/pdf.mjs:17363
    maybeShow http://127.0.0.1:43971/build/generic/build/pdf.mjs:17394
    show http://127.0.0.1:43971/build/generic/build/pdf.mjs:15800
    disable http://127.0.0.1:43971/build/generic/build/pdf.mjs:23851
    #disableAll http://127.0.0.1:43971/build/generic/build/pdf.mjs:3462
    updateMode http://127.0.0.1:43971/build/generic/build/pdf.mjs:3307
    updater http://127.0.0.1:43971/build/generic/web/viewer.mjs:14096
    set annotationEditorMode http://127.0.0.1:43971/build/generic/web/viewer.mjs:14131
    bindEvents http://127.0.0.1:43971/build/generic/web/viewer.mjs:17041
    dispatch http://127.0.0.1:43971/build/generic/web/viewer.mjs:1461
    bindListeners http://127.0.0.1:43971/build/generic/web/viewer.mjs:15487
pdf.mjs:17205:7

What is the expected behavior?

The integration should pass.

What went wrong?

The integration should fails consistently.

Link to a viewer

No response

Additional context

This regressed in PR #20231 which already contained this problem in the logs but was missed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions