Repository navigation
Conversation
|
Preview deployed: https://preview-1456.staging.documentcloud.org |
dnass
force-pushed
the
modified-document-processing
branch
2 times, most recently
from
November 10, 2026 22:56
87a87a0 to
9a400cf
Compare
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dnass
marked this pull request as ready for review
November 11, 2026 16:46
dnass
force-pushed
the
modified-document-processing
branch
from
November 12, 2026 17:51
9a400cf to
87edbc9
Compare
dnass
force-pushed
the
modified-document-processing
branch
from
November 13, 2026 00:25
87edbc9 to
61c93d2
Compare
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 free
to 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.
Reprocessing a modified document on the server happens in several steps:
processingpage_specandupdated_attimestamps are updated, and status changes tosuccessThis PR ensures that the user sees the correct layout for the modified document at every step.
After modifications are saved, the new layout is added to a store keyed to the document ID. The layout store is persisted to local storage using
saveStore. When a stored layout is present for a document, it overrides the page spec to become the source of truth for page ordering and dimensions.In order to determine when the PDF has been overwritten,
ViewerStatetracks the file'sLast-Modifiedheader. If the current PDF's timestamp doesn't match the stored layout timestamp, it means the user has reloaded the viewer after the PDF was rewritten but before processing was complete (i.e. after step 2). In this case, the PDF viewer doesn't apply reordering or rotations from the stored layout because the page is being rendered from the new file. (This prevents the modifications from being applied twice.)After the page images have been deleted but not yet regenerated (step 3), thumbnails in grid layout fail to load. Those image elements now watch for loading errors and show a loading spinner in place of missing images. Image URLs also use the document's
updated_attimestamp as a cache-busting param to ensure the fresh versions are loaded after reprocessing is complete.After the document is finished reprocessing, the stored layout is deleted and the document is rendered normally.