feat(import): surface S3 upload failures in skippedFiles #619
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
When
importSingleDocumentfails to upload a file to S3, it currently returnsfalseand logs an error, but the document is neither counted inprocessednor added toskippedFiles. An admin viewing the DONE card after such an import sees only the success count with no indication that files were silently dropped.This was pre-existing behaviour before #529. Now that
skippedFilesexists as a mechanism to surface failures, S3 errors should land there too.Proposed change
When the S3
putObjectcall throws, add the filename toskippedFileswith reasonS3_UPLOAD_ERRORinstead of silently returningfalse.Add i18n key for
import_reason_s3_upload_error(de/en/es).Acceptance criteria
skippedFilescontains an entry for that file with reasonS3_UPLOAD_ERRORisPdfMagicBytestestsRelated
Surfaced during review of #618. The
importSingleDocumentboolean return contract (conflating "already exists" vs "upload failed") is tracked separately in #[refactor issue].