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

Description

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.

Screen Shots

recording_20260710_122921.mp4

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This contribution adheres to our Engineering process (RFC/Technical Design/ADR)
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

@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 2 times, most recently 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

@rafaeltonholo

Copy link
Copy Markdown
Member

Hi @mohitsatr, now that the AttachmentController is already converted to Kotlin, would you please rebase your changes and apply the fix?

Thanks

@mohitsatr
mohitsatr force-pushed the attachment-overrriden branch from 8de676d to a470490 Compare July 10, 2026 06:01
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