Skip to content

chore(db-repository): convert message download operations to suspend functions - #11604

Merged
rafaeltonholo merged 1 commit into
thunderbird:mainfrom
rafaeltonholo:rafaeltonholo/create-message-repositories--c-e9f0142
Sep 28, 2026
Merged

rafaeltonholo merged 1 commit into
thunderbird:mainfrom
rafaeltonholo:rafaeltonholo/create-message-repositories--c-e9f0142

Conversation

@rafaeltonholo

@rafaeltonholo rafaeltonholo commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Stack

  1. 3da3110 feat(db-repository): add domain models for messages, attachments, and thread messages #11593 (id: c-9653617)
  2. 4c35913 refactor(db-repository): convert message download operations to suspend functions (id: c-e9f0142) <-- current
  3. [detached] 18b15b0 feat(core-architecture): add AsyncDataMapper interface for domain-DTO conversion #11606 (id: c-facc931)
  4. 8a393e3 feat(db-repository): add DefaultMessageDataMapper for legacy-to-domain message conversion #11607 (id: c-9ed62a1)
  5. f12481d feat(db-repository): add MessageQueryRepository for querying messages by criteria #11608 (id: c-be36e42)
  6. f0da3d5 feat(db-repository): implement create message in MessageLifecycleRepository #11609 (id: c-639ad93)
  7. 4f9accc feat(db-repository): implement update message in MessageLifecycleRepository #11610 (id: c-a66bc30)
  8. 168347d feat(db-repository): implement move message in MessageLifecycleRepository #11611 (id: c-7f7af18)
  9. 8506a59 feat(db-repository): implement copy and copyAll in MessageLifecycleRepository #11612 (id: c-145c77c)
  10. b0d9b9f feat(db-repository): replace destroy with destroyAllByServerId and destroyByServerId #11613 (id: c-99f9e08)

Contribution Summary

Linked Issue/Ticket: Part of #11486
RFC / Technical Design (if applicable):

Description

  • Add suspend modifier to Backend.downloadCompleteMessage and related chain
  • Add suspend to BackendFolder.saveMessage and FetchListener.onFetchResponse
  • Add suspend to ImapFolder.fetch and ImapSync download methods
  • Wrap blocking Backend calls with runBlocking(ioDispatcher) in implementations
  • Add downloadCompleteMessageBlocking wrapper for legacy MessagingController
  • Add ioDispatcher parameter to DemoBackend and ImapBackend constructors
  • Replace direct runBlocking calls in Pop3Sync with proper suspend propagation

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).

@rafaeltonholo
rafaeltonholo requested a review from a team as a code owner September 23, 2026 10:58
@rafaeltonholo rafaeltonholo added report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). pr: stacked Must be used on a PR that is stacked on top of other(s) labels Sep 23, 2026
@github-actions github-actions Bot added the tb-team Tasks and features handled by project maintainers label Sep 23, 2026
@rafaeltonholo
rafaeltonholo force-pushed the rafaeltonholo/create-message-repositories--c-e9f0142 branch from eefd50f to 4c35913 Compare September 23, 2026 12:08
@rafaeltonholo
rafaeltonholo force-pushed the rafaeltonholo/create-message-repositories--c-e9f0142 branch 4 times, most recently from 792797e to 8cf3d83 Compare September 24, 2026 17:31
wmontwe
wmontwe previously approved these changes Sep 28, 2026

@wmontwe wmontwe 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.

Thank you!

@rafaeltonholo
rafaeltonholo dismissed wmontwe’s stale review September 28, 2026 11:12

The merge-base changed after approval.

…nd functions

- Add suspend modifier to Backend.downloadCompleteMessage and related chain
- Add suspend to BackendFolder.saveMessage and FetchListener.onFetchResponse
- Add suspend to ImapFolder.fetch and ImapSync download methods
- Wrap blocking Backend calls with runBlocking(ioDispatcher) in implementations
- Add downloadCompleteMessageBlocking wrapper for legacy MessagingController
- Add ioDispatcher parameter to DemoBackend and ImapBackend constructors
- Replace direct runBlocking calls in Pop3Sync with proper suspend propagation

GG-ID: c-e9f0142
@rafaeltonholo
rafaeltonholo force-pushed the rafaeltonholo/create-message-repositories--c-e9f0142 branch from 8cf3d83 to 4b0e06b Compare September 28, 2026 11:15
@rafaeltonholo
rafaeltonholo merged commit 3348484 into thunderbird:main Sep 28, 2026
17 checks passed
@rafaeltonholo
rafaeltonholo deleted the rafaeltonholo/create-message-repositories--c-e9f0142 branch September 28, 2026 12:29
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 25 milestone Sep 28, 2026

This branch was successfully deployed

2 active (1 outdated) deployments
botmobile — 4b0e06b9 Deployed Sep 28, 2026 by rafaeltonholo via pr-merged #546
review — eefd50f1 Deployed Sep 23, 2026 by rafaeltonholo via label-tb-team #533
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: stacked Must be used on a PR that is stacked on top of other(s) report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants