Repository navigation
fix: Avoid saving the draft to the wrong mailbox when switching the mailbox - #3084
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Realm selection in NewMessageViewModel can still race with account switching and save a draft under the previous user.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Targets draft persistence and processing at the mailbox explicitly associated with each draft.
Changes:
- Opens mailbox-specific Realm instances for draft creation and workers.
- Refactors draft queries to accept explicit Realm instances.
- Adds worker coverage for mailbox switching.
| File | Description |
|---|---|
MailActionsManager.kt |
Uses the worker’s targeted Realm. |
DraftsActionsWorker.kt |
Opens Realm using work input IDs. |
NewMessageViewModel.kt |
Selects a Realm for the draft mailbox. |
RealmDatabase.kt |
Restricts implicit current-mailbox Realm creation. |
DraftController.kt |
Exposes Realm-specific draft operations. |
MailActionsManagerTest.kt |
Updates calls for refactored APIs. |
DraftsActionsWorkerTest.kt |
Tests targeted-mailbox draft processing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
FabianDevel
requested changes
Oct 1, 2026
tevincent
force-pushed
the
fix-access-draft-wrong-mailbox
branch
from
October 2, 2026 06:11
274c50b to
2b68628
Compare
tevincent
enabled auto-merge
October 2, 2026 06:11
FabianDevel
approved these changes
Oct 2, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




No description provided.