Skip to content

Fix: Save all option overrides attachment files#10967

Open
mohitsatr wants to merge 1 commit into
thunderbird:mainfrom
mohitsatr:attachment-overrriden
Open

Fix: Save all option overrides attachment files#10967
mohitsatr wants to merge 1 commit into
thunderbird:mainfrom
mohitsatr:attachment-overrriden

Conversation

@mohitsatr

@mohitsatr mohitsatr commented May 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #10965

Changes:

  1. Makes use of OpenDocumentTree Contract for onSaveAllAttachments option to let users choose a destination folder for all the attachments. Previously, we were forced to click 'save' for each attachment file.
  2. Convert AttachmentController.java to Kotlin to make use of Coroutines.

Behaviour:

Screen_Recording_20260506_085902_Thunderbird.Debug.mp4

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Validation Passed: All report and feature-flag labels are correctly set.

@mohitsatr mohitsatr force-pushed the attachment-overrriden branch from 09cfb0a to f76dfdb Compare May 5, 2026 12:29
@mohitsatr mohitsatr force-pushed the attachment-overrriden branch from f76dfdb to 8de676d Compare May 6, 2026 03:30
@mohitsatr mohitsatr marked this pull request as ready for review May 6, 2026 03:44
@mohitsatr mohitsatr requested a review from a team as a code owner May 6, 2026 03:44
@mohitsatr mohitsatr requested a review from dani-zilla May 6, 2026 03:44
@mohitsatr mohitsatr changed the title (WIP) Fix: Save all option overrides attachment files Fix: Save all option overrides attachment files May 6, 2026
@platform34 platform34 mentioned this pull request May 25, 2026
2 tasks
@dani-zilla dani-zilla added the report: include Include changes in user-facing reports. label Jun 1, 2026
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.withContext
import net.thunderbird.core.android.account.LegacyAccountDto
import net.thunderbird.core.logging.legacy.Log.e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is one we're planning on deprecating. I understand this was a kotlin conversion of a Java class, but if we're introducing new code (and a small change at that) we should use the newer class. It's net.thunderbird.core.logging.Logger. You can inject an instance of it.

We have more details of it here: https://github.com/thunderbird/thunderbird-android/blob/49e1eab7e2df55ac83ec02e6e3f8c370ac4843c1/core/logging/README.md

@rafaeltonholo rafaeltonholo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we are aiming to migrate all Java to Kotlin, the conversion should not be done in bug fixes like this one. Having a Kotlin conversion in the same changeset as a bug fix makes it harder to review and to revert in case of necessity. Please, revert the AttachmentController Kotlin conversion and apply the fix on the Java side.

@mohitsatr

Copy link
Copy Markdown
Contributor Author

@rafaeltonholo
I'm not familiar with AyncTasks.
Would it be okay if I send a separate PR for AttachmentController.java -> .kt conversion first, and then continue on this PR?

@rafaeltonholo

Copy link
Copy Markdown
Member

@rafaeltonholo I'm not familiar with AyncTasks. Would it be okay if I send a separate PR for AttachmentController.java -> .kt conversion first, and then continue on this PR?

Yes, please! Here is the GitHub issue for the conversion: #11096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: include Include changes in user-facing reports.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More than 1 attached file overridden by the option "Save all"

3 participants