Skip to content

Always set page text positions and prevent data clobber - #455

Merged
duckduckgrayduck merged 4 commits into
masterfrom
always_set_page_text
Aug 18, 2026
Merged

Always set page text positions and prevent data clobber#455
duckduckgrayduck merged 4 commits into
masterfrom
always_set_page_text

Conversation

@duckduckgrayduck

@duckduckgrayduckduckduckgrayduck commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Closes#442
Closes#443

Refactors a bit to make it easier to reason with and moves it before the grafting guard so we guarantee it runs.
Tested on staging and verified it works.

Example document on staging:
https://www.staging.documentcloud.org/documents/20012188-dossier-recu-complet-le-3-mars-2025/
https://documentcloud-staging-files.s3.amazonaws.com/documents/20012188/pages/dossier-recu-complet-le-3-mars-2025-p1.position.json

https://documentcloud-staging-files.s3.amazonaws.com/documents/20012188/dossier-recu-complet-le-3-mars-2025.txt.json

The page text and page positions are in alignment and both updated by Azure Add-On.

The set_page_text task now calls save() with specified update fields so we don't clobber a concurrent write to data.
I added a regression test to prevent this from happening again. I confirmed the test fails on current master code and passes on this branch. I also ran the Azure Add-On without checking for status codes and confirmed that all of the key/value pairs stick.

@duckduckgrayduckduckduckgrayduck changed the title Always set page text positions even if we can't graftAlways set page text positions and prevent data clobberAug 18, 2026
@duckduckgrayduck
duckduckgrayduck merged commit 5c7541f into masterAug 18, 2026
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix clobbering of data on page text saves We should still set page text positions even if we don't graft text back in

2 participants

@duckduckgrayduck@mitchelljkotler