INC-152057 · Issue 621209
S3 attachment migration handles LInk-Attachment with multiple instances
Resolved in Pega Version 8.3.6
After S3 attachment migration, some attachments were intermittently not opening and displaying an error relating to being unable to load the file. Investigation showed that the attachments that failed to open did not have a pxStorageType tag in the XML of the work item. After the migration is done, the corresponding Data-WorkAttach-File and Link-Attachment instances are updated to point them to the repository. In this case, multiple LInk-Attachment instances were pointing to the same Data-WorkAttach-File instances, so only one Link-Attachment was updated and all of the other instances pointing to the same Data-WorkAttach-File instance were rendered unusable. While there was a workaround of manually updating the storage type in the database, this has been resolved by updating "pzgetattachmentcontent","pzupdatesourcereferences", and "pzuploadcontenttoexternalstorage" to check whether attachment is already migrated or not using the boolean parameter "isAttachmentAlreadyMigrated" to ensure all of the other Link-Attachment instances for a particular attachment are updated. If a migration was done and all Data-WorkAttach-File instances are pointing to a repository with some Link-Attachment instances not updated, those will be updated by running the migration again.