SUBMISSION-207: Reset is_source_processed and clear preview on file change.#93
Merged
Merged
Conversation
DavidLFielding
marked this pull request as ready for review
July 22, 2026 16:19
DavidLFielding
requested review from
bdc34,
bmaltzan,
jweiskoff and
norbusan
as code owners
July 22, 2026 16:19
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.
Summary. After a submission was processed, editing its files left it incorrectly marked as "processed," so the workflow could skip recompiling the changed source and could reference a stale preview. This resets the processing state on any file change, forcing reprocessing of the new source — for both TeX and PDF-only submissions.
Problem. The file-change events (UploadFiles, UploadArchive, RemoveFiles, RemoveAllFiles) delete the derived artifacts (preview, compile log, preflight, directives, source package) but never reset the submission's processing state. So after a submission is processed (is_source_processed=True), editing files left it wrongly marked processed:
legacy must_process stayed 0 ("already processed");
the Process stage's completion gate (conditions.is_source_processed) stayed satisfied, letting the workflow skip recompilation of the changed source;
submission.preview dangled at a now-deleted preview file (which ConfirmPreview.validate later checksum-matches).
This affected both TeX and PDF-only submissions, which route through the same common_file_change* helpers.
Fix. Extend the shared _common_file_change_project(submission) helper — already called by all four file-change events' project() — to also set is_source_processed=False and preview=None, mirroring UnConfirmSourceProcessed. Because is_source_processed round-trips to the legacy must_process column, must_process correctly returns to 1 after any file change.
Tests. Added test_upload_resets_processing_state and test_remove_all_resets_processing_state: a processed submission (is_source_processed=True, preview set) has both reset after an upload or remove-all.