Skip to content

fix: do not create informatieobject when file content is empty - #40

Merged
mvdhoek1 merged 2 commits into
OpenWebconcept:mainfrom
Scottielee33:fix/skip-empty-informatieobject-content
Sep 24, 2026
Merged

mvdhoek1 merged 2 commits into
OpenWebconcept:mainfrom
Scottielee33:fix/skip-empty-informatieobject-content

Conversation

@Scottielee33

@Scottielee33 Scottielee33 commented Sep 23, 2026 •

Copy link
Copy Markdown

Problem

When retrieving an uploaded file fails (timeout, non-2xx response, empty body), encode_base64_from_url() logs an error and returns ''. prepare_information_object_args() does not check this, so an enkelvoudiginformatieobject is still created with an empty inhoud, connected to the zaak and counted as a successful upload. The receiving DMS ends up with an empty document and the submission is not flagged as failed.

The same applies to a 0-byte submission PDF in prepare_args_pdf().

Change

  • AbstractCreateUploadedDocumentsAction::prepare_information_object_args() returns an empty array when the content is empty. create_information_object() then returns null, so add_uploaded_documents() returns false and the existing ZaakUploadException / transaction reporting path handles it.
  • AbstractCreateSubmissionPDFAction::prepare_args_pdf() also treats empty file contents as a failure.
  • The file content is now retrieved before the HEAD requests, so no extra requests are made when retrieval fails.
  • encode_base64_from_url() now also logs an error when the response body is empty (non-2xx and request errors were already logged), so every failed retrieval can be traced to a URL.

Scottie Lee added 2 commits September 23, 2026 12:56
When retrieving an uploaded file fails, encode_base64_from_url() returns
an empty string. The informatieobject was still created with an empty
'inhoud' and reported as successful. Skip creation instead, so the
upload is reported as failed. Same for an empty submission PDF.
@Scottielee33
Scottielee33 force-pushed the fix/skip-empty-informatieobject-content branch from 435f88c to 15d5431 Compare September 23, 2026 10:56
@mvdhoek1
mvdhoek1 merged commit 4e987b1 into OpenWebconcept:main Sep 24, 2026
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.

2 participants