Skip to content

Give copied annotations distinct references - #21707

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
calixteman:fix/pdf-editor-copy-new-annotations
Aug 4, 2026
Merged

timvandermeij merged 1 commit into
mozilla:masterfrom
calixteman:fix/pdf-editor-copy-new-annotations

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

When a viewer page was copied, each copy got its own annotationStorage entry, but newAnnotationsByPage was keyed only by source page. As a result, every output copy received all entries and reused their memoized references.

Tag each entry with its rank among output copies of the same source page. The display and worker compute this rank independently; inserted documents preserve the order of copies. Keep unextracted entries at rank -1 so shared stamp bitmaps remain available without being written. Without ranks, new annotations are applied only to the first copy.

When a viewer page was copied, each copy got its own annotationStorage
entry, but newAnnotationsByPage was keyed only by source page. As a
result, every output copy received all entries and reused their memoized
references.

Tag each entry with its rank among output copies of the same source page.
The display and worker compute this rank independently; inserted documents
preserve the order of copies. Keep unextracted entries at rank -1 so shared
stamp bitmaps remain available without being written. Without ranks, new
annotations are applied only to the first copy.
@codecov-commenter

codecov-commenter commented Aug 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (e57a464) to head (bf7c925).

Files with missing lines Patch % Lines
web/app.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21707      +/-   ##
==========================================
+ Coverage   90.04%   90.05%   +0.01%     
==========================================
  Files         264      264              
  Lines       66894    66933      +39     
==========================================
+ Hits        60232    60275      +43     
+ Misses       6662     6658       -4     
Flag Coverage Δ
browsertest 66.47% <23.52%> (-0.05%) ⬇️
fonttest 9.03% <ø> (ø)
integrationtest 69.38% <81.48%> (+0.02%) ⬆️
unittest 57.96% <76.47%> (+0.08%) ⬆️
unittestcli 56.71% <76.47%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timvandermeij
timvandermeij merged commit 5f181fd into mozilla:master Aug 4, 2026
21 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Looks good to me; thanks!

This branch was previously deployed

1 inactive deployment
code-coverage — bf7c9258 Deployed Aug 4, 2026 by calixteman via Test (26) #16622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants