Drag-and-drop multiple image attachments don't show, but are saved in the draft

Description

When drag-and-dropping more than one image file, only the first one shows up as a preview. The remaining files are saved in the draft, but can’t be deleted. I discovered this when trying to add more attachments and Mailspring gave me the warning that I can’t attach more than 25MB of files, even though the file itself was smaller (1MB) and Mailspring showed no other attachments.
→ The attachments are saved, but they don’t show up and can’t be deleted.

Additional information:

  • Issue only seems to appear with image files that have a preview, such as .png, .jpg, .gif, that I tested.
    Image files bigger than 5MB don’t seem to be affected, as they don’t create a preview but show up like other files types.
  • Issue persists when saving the draft and reopening it. The image files are still saved somewhere, but don’t show up and add to the 25MB attachment limit. Draft list shows an attachment (see screenshot1), email editor doesn’t (see screenshot2)
  • When sending an email with “invisible attachments”, no attachments are actually sent.

To Reproduce…

Steps to reproduce the behavior:

  1. Compose a new message
  2. Add multiple image attachments via drag and drop
  3. Only one of the images appears as a preview

Steps to reproduce the attachment limit warning / get proof that files are saved somethere:

  1. Compose a new message
  2. Add at least two image attachments via drag and drop. Their individual size has to be <5MB because bigger image files don’t show up as preview.
  3. A preview for one of the images shows up. Delete it.
  4. Add more attachments that are smaller than 25MB but exceed 25MB when adding the size of the previously added attachments minus the deleted one.
  5. Warning shows up (see screenshot2), no attachments show up.

Expected Behavior

All attachments appear as a preview or as normal file attachments

Screenshots

Screenshot 2024-08-01 151628
Draft list shows an attachment


Email editor shows no attachments but gives a warning when trying to add more. The file I tried to add was 5MB.

Setup

  • OS and Version: Windows 10 22H2
  • Mailspring Version: 1.13.3 - 9a7e1a78

Additional Context

This seems to be the same issue as the following bug report:
Additional information in my post includes that attachments seem to be saved in the draft, but are invisible. They are not included when sending the email. Invisible files filling up the 25MB attachment limit can be a consequence of this bug.