thunderbird/thunderbird-android

Incorrect numbering when saving duplicate attachments for application/octet-stream attachments

Open

#9,141 opened on May 8, 2025

View on GitHub
 (8 comments) (0 reactions) (0 assignees)Kotlin (13,479 stars) (2,734 forks)batch import
good first issuetype: bug

Description

Checklist

  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.

App

K-9 Mail

App version

9.0

Where did you get the app from?

F-Droid

Android version

Android 15, CalyxOS 6.6.23

Device model

Fairphone 4 (FP4)

Steps to reproduce

  1. Receive a mail with an attachment.
  2. Save that and do it again with another mail with the same attachment (I guess it also works for the same mail).

Expected behavior

Let's say the attachment is named file.pdf. Given a file named file.pdf already exists in the Downloads folder, the file should be named file (2).pdf or similar.

Actual behavior

The file is named file.pdf (1). This is not (actually) (very) funny, but causes problems, because many applications including the built-in file picker of Android do not detect that as a PDF file anymore in that example. So this breaks a lot of functionality in a subtle way and you have to look twice and have at least basic knowledge about files (notably many people may not have this anymore) to fix it. Thing is it e.g. may also break images and people could wonder why they don't see saved images in their gallery etc.

Workaround: renaming, of course

Another less erious issue: Notice how it is suffixed with (1)? While this may make sense for technical people, it makes less for everyone else. I checked how Nautilus (GNOME file manager) does it e.g. when I copy a file in the same dir and it names them file (copy).pdf and even file (second copy).pdf for the second.

And if I copy a file that already exists in the target location (which is likely more similar to the issue at hand), I can rename it and the default suggestion is: file (2).pdf: Image

IMHO both versions are a better UX.

Logs

k9mail-logs_duplicatefile.txt

Contributor guide