Uh oh!
There was an error while loading. Please reload this page.
Always set page text positions and prevent data clobber - #455
Merged
Conversation
mitchelljkotler
approved these changes
Aug 18, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.