Skip to content

Skip pages that pass validation but fail to read during concatenation - #1105

Merged
rajeswaripedaballi merged 4 commits into
mainfrom
concatenate-failure
Sep 24, 2026
Merged

rajeswaripedaballi merged 4 commits into
mainfrom
concatenate-failure

Conversation

@rajeswaripedaballi

@rajeswaripedaballi rajeswaripedaballi commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

There were few "no valid files to concatenate" crashes even after the last fix. The page already passed the check, but the file still failed when the code went to use it, probably a storage write that wasn't fully finished. That specific step was not handled, so it crashed the whole document instead of just skipping that one piece.

This catches the failure right where it happens and skips it instead of crashing, across the exhibit, the exhibit list, and the combined exhibit doc.

Also added: when an exhibit fails this way, it now marks itself as broken so the existing warning message shows it to the user, instead of it just quietly disappearing from the download. Updated the warning text too, since it used to say the file didn't upload correctly, but the upload was fine, it's the processing afterward that failed.

It stops the crash and tells the user something went wrong.

@nonprofittechy

Copy link
Copy Markdown
Member

Not sure about this one, since we're silently skipping a file that the user uploaded, right?

@rajeswaripedaballi

Copy link
Copy Markdown
Contributor Author

Not sure about this one, since we're silently skipping a file that the user uploaded, right?

Yes that's correct, that was happening, sorry I missed it the first time. I fixed it now, the exhibit marks itself broken when this happens, so the warning shows it instead of it silently disappearing. My guess is it may be tied to the image conversion itself, I saw a few JPG conversion failures right before the crash in at least one session, though I'm not sure yet if that's the actual cause or something else going on, like a timing or file-handling issue.

@nonprofittechy

Copy link
Copy Markdown
Member

great, with that clarification + update will leave for @BryceStevenWilley to finish review unless he prefers me to finish

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes are narrowly scoped, add test coverage for the new behavior, and primarily improve failure handling without introducing risky logic changes.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

This PR improves resilience of exhibit PDF generation in al_document.py by handling pdf_concatenate failures that can occur even after pages/exhibits pass earlier validation, preventing “no valid files to concatenate” crashes and surfacing failures to users via the existing “broken” warning mechanism.

Changes:

  • Catch DAError from pdf_concatenate during exhibit/page concatenation and skip the failing output instead of crashing.
  • Track exhibits that fail during processing (_failed_during_processing) so they appear as broken (and therefore show up in the warning banner).
  • Update warning text and add unit tests covering the new failure mode and broken-exhibit reporting.
File Description
docassemble/​AssemblyLine/​al_document.py Adds DAError handling around concatenation, tracks processing failures as “broken,” and updates the warning banner wording.
docassemble/​AssemblyLine/​test_al_document.py Adds tests for concatenation failure behavior and updates assertions for the new warning text.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docassemble/AssemblyLine/al_document.py Outdated
Comment thread docassemble/AssemblyLine/al_document.py

@BryceStevenWilley BryceStevenWilley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rajeswaripedaballi
rajeswaripedaballi merged commit e587cd1 into main Sep 24, 2026
8 checks passed
@rajeswaripedaballi
rajeswaripedaballi deleted the concatenate-failure branch September 24, 2026 15:04
Sign up for free to 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.

4 participants