Skip to content

Conversation

@sachiniyer
Copy link

I noticed that addDeletedAnnotationElement takes an editor object not an annotation element id. I think this is papered over by the creation of a fake editor, which then results in the deletion of the annotation.

However, I think this change preserves the types, and keeps the deletion list accurate.

@calixteman
Copy link
Contributor

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/dae3c6d7b9d0885/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/6f739c5c046b4d4/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/dae3c6d7b9d0885/output.txt

Total script time: 19.63 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/6f739c5c046b4d4/output.txt

Total script time: 42.41 mins

  • Integration Tests: Passed

@calixteman
Copy link
Contributor

So it's a fixing a real issue I can easily reproduce in moving an existing annotation from a page to another.
I created a pdf with two pages and a stamp annotation on the bottom of the first page:
firefox_stamp.pdf
Would it be possible to write an integration test pretty similar to:

it("must move an annotation", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
const modeChangedHandle = await waitForAnnotationModeChanged(page);
await page.click(getAnnotationSelector("25R"), { count: 2 });
await awaitPromise(modeChangedHandle);
const editorSelector = getEditorSelector(0);
await waitForSelectedEditor(page, editorSelector);
const editorIds = await getEditors(page, "stamp");
expect(editorIds.length).withContext(`In ${browserName}`).toEqual(5);
// All the current annotations should be serialized as null objects
// because they haven't been edited yet.
const serialized = await getSerialized(page);
expect(serialized).withContext(`In ${browserName}`).toEqual([]);
// Select the annotation we want to move.
await selectEditor(page, editorSelector);
await dragAndDrop(page, editorSelector, [[100, 100]]);
await waitForSerialized(page, 1);
})
);
});
});
?
The zoom level must be small enough to be sure we've the two pages in the view and then move the stamp from page 1 to the top of page 2 to make sure that everything is fine.
In order to just run your test you can set fdescribe or fit on it and then run it with npx gulp integrationtest.
Tell me if you don't want to write it and I'll merge your PR and will do a follow-up with a test.

@sachiniyer
Copy link
Author

sachiniyer commented Nov 1, 2025

I added an integration test, and checked that it fails without this change (unfamiliar with the testing framework, so please lmk if there is a better way to write it).

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please squash the commits into one after addressing the comment, and then we can trigger the integration tests on the bots.

@sachiniyer sachiniyer force-pushed the siyer/fix-annotation-editor-deletion branch from bc53e29 to 7d55b6e Compare November 3, 2025 21:21
@sachiniyer
Copy link
Author

Hey @timvandermeij thanks for taking a look!

I've addressed the comment and squashed the changes together.

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with passing integration tests; thank you! @calixteman Feel free to merge this if you're also OK with this version.

@timvandermeij
Copy link
Contributor

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/431e3b62645872c/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 1

Live output at: http://54.193.163.58:8877/497750ef6abd11f/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/431e3b62645872c/output.txt

Total script time: 20.22 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/497750ef6abd11f/output.txt

Total script time: 44.75 mins

  • Integration Tests: FAILED

@sachiniyer sachiniyer force-pushed the siyer/fix-annotation-editor-deletion branch from 8a2569e to 4a87426 Compare November 9, 2025 23:04
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.

4 participants