refactor: Remove code that moves messages between IMAP folders - #8734
Merged
Merged
Conversation
Hocuri
force-pushed
the
hoc/remove-imap-moving-code
branch
from
September 22, 2026 12:37
96edf00 to
c8a6b61
Compare
link2xt
reviewed
Sep 22, 2026
| // message, move it to the movebox and then download the second message before | ||
| // downloading the first one, if downloading from inbox before moving is allowed. | ||
| if folder == target | ||
| if !delete |
Collaborator
There was a problem hiding this comment.
Maybe add debug_assert!(delete || folder == target) so it crashes in tests if we somehow set target to something other than folder.
Collaborator
Author
There was a problem hiding this comment.
Just a few lines above we have let target = if delete { "" } else { folder };, but I'll add this debug_assert to delete_messages()
link2xt
reviewed
Sep 22, 2026
| for (target, rowid_set, uid_set) in UidGrouper::from(rows) { | ||
| // Select folder inside the loop to avoid selecting it if there are no pending | ||
| // MOVE/DELETE operations. This does not result in multiple SELECT commands | ||
| // DELETE operations. This does not result in multiple SELECT commands |
Collaborator
There was a problem hiding this comment.
This can probably simplified in a follow-up as well, comment is outdated because we never select any folder other than INBOX (or whatever is configured in imap_folder which then acts as an inbox). We can select the folder right after login and then be sure we never unselect it.
link2xt
approved these changes
Sep 22, 2026
Hocuri
force-pushed
the
hoc/remove-imap-moving-code
branch
from
September 22, 2026 12:52
c8a6b61 to
051f96b
Compare
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.
Follow-up to #8456
This PR removes code that was needed for moving messages between IMAP folders. We haven't been moving messages since a long time already, so, this code was dead.
I also added a second commit that removes the unused ImapMessageMoved event.
What this PR does NOT yet do:
delete_messages- The code there could be slightly simplified, but then we need to be very careful not to introduce a bug that wrongly deletes messagesselect_folder()/select_with_uidvalidity()- can be done in a follow-up