Closed Bug 1827973 Opened 1 year ago Closed 6 months ago

File | Compact Folders grayed when imap maildir folder selected and can otherwise only affect the selected folder; right-click context on imap maildir folder shows no Compact

Categories

(MailNews Core :: Backend, defect)

Thunderbird 114
defect

Tracking

(thunderbird_esr115 fixed, thunderbird119 fixed)

RESOLVED FIXED
120 Branch
Tracking Status
thunderbird_esr115 --- fixed
thunderbird119 --- fixed

People

(Reporter: gds, Assigned: gds)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: regression, Whiteboard: [TM:115.5.2][snnot3p])

Attachments

(1 file, 1 obsolete file)

Attached patch compact-expunge-maildir.diff (obsolete) — Splinter Review

+++ This bug was initially created as a clone of Bug #1130277: "No obvious way to expunge imap maildir folder" +++

With post-102 dailies and betas there has become again no way to immediately expunge or compact out messages in maildir folders that are marked as deleted (crossed out). With I02 and earlier it was possible to do this with the File | Compact Folders menu item, even though it actually iterated though all the imap folders, compacting all of them and not just the currently selected folder. Now when a imap based maildir folder is selected the "Compact Folders" File menu item is grayed out (and the right-click context doesn't show "Compact") so there is no way to expunge the crossed out messages.

It also appears the File | Compact Folders, when not gray, now only initiates compact and imap expunge on the currently selected folder, not on ALL folders as the name implies and how it actually worked with 102 and earlier. If this is not a regression and that is the intended new usage for File | Compact Folders it should be labeled "File | Compact Current Folder" or "File | Compact Folder" since it now only affects a single currently selected folder.

The attached diff allows the "File | Compact Folders" to be un-grayed and the right-click context item "Compact" on an imap maildir folder to be visible and perform the needed imap expunge and removal of the permanently deleted message files from maildir's "cur" directory. This is basically the same diff as was attached and described at bug 1130277 that this bug was cloned from.
This diff doesn't address the possible regression that "File | Compact Folders" only affects the selected folder.

Version: 31 → Thunderbird 114
See Also: → 1828012
Whiteboard: [snnot]
See Also: → 1823546

From comment 0:

With I02 and earlier it was possible to do this with the File | Compact Folders menu item, even though it actually iterated though all the imap folders, compacting all of them and not just the currently selected folder.

To be exact I should have said "it actually iterated though all the imap folders of the currently selected account, compacting all of them and not just the currently selected folder".

Whiteboard: [snnot] → [snnot3p]
See Also: → 1853584
See Also: → 1852998

This also allows imap EXPUNGE to occur when compacting folder just like with mbox.

Assignee: nobody → gds
Status: NEW → ASSIGNED

From comment 0:

This diff doesn't address the possible regression that "File | Compact Folders" only affects the selected folder.

This issue was recently pointed out in bug 1853584. The way it works for mbox (and maildir only with my patch) is that if you are selected on a top level imap account name, File | Compact Folders or the context item Compact will compact/expunge ALL the folders of the account. If you are selected on an imap folder, File | Compact Folders (non-gray when maildir only with my patch) or the context item Compact (visible for maildir only with my patch) will only affect that selected folder. So maybe that's the intended behavior and not a bug, not sure.
Maybe the menu item should just be File | Compact since it only affect "Folders" (plural) when you are selected on the account name.

I reverted my patch and checked again. I was wrong about something. If you are selected on an maildir imap account name (top level "root") you do see the "Compact" context item and "File | Compact Folders" both NOT gray and both initiate the compact/expunge on all folders of the selected account.
But without my patch, you just don't see the "Compact" context item and "File | Compact Folder" remain gray for imap maildir folders, so it just fixes that.

Attachment #9357699 - Attachment description: Bug 1827973 - Enable compact menu and context items for maildir imap accounts and folders. r=mkmelin → Bug 1827973 - Show "Compact" folder context item for imap accounts using maildir. r=mkmelin
Attachment #9328415 - Attachment is obsolete: true
Target Milestone: --- → 120 Branch

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/637f29e80608
Show "Compact" folder context item for imap accounts using maildir. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED

Comment on attachment 9357699 [details]
Bug 1827973 - Show "Compact" folder context item for imap accounts using maildir. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9357699 - Flags: approval-comm-beta+
Whiteboard: [snnot3p] → [TM:115.4.1][snnot3p]
Duplicate of this bug: 1852998

Good to take on esr?

Flags: needinfo?(gds)
Whiteboard: [TM:115.4.1][snnot3p] → [TM:115.5.2][snnot3p]

(In reply to Wayne Mery (:wsmwk) from comment #10)

Good to take on esr?

I'm not a big maildir user but I just tried it again on a maildir account and it still looks good to me. So if you haven't heard any complaints on this, I would say yes.

Flags: needinfo?(gds)

Can't we stop using compact as a word when using maildir. The process being "exposed" is expunge and really is unrelated at all to compacting as it relates to MBOX.

(In reply to Matt from comment #12)

Can't we stop using compact as a word when using maildir. The process being "exposed" is expunge and really is unrelated at all to compacting as it relates to MBOX.

Yes, "Compact" does trigger an imap expunge for both maildir and mbox.

For maildir, if you use "just mark as deleted" mode and you delete a message, its file remains present in the maildir "cur" directory on filesystem. Then if you do the "compact" command, the mailbox is imap is expunged and the file is removed from the "cur" directory. So, in a sense, the maildir directory on the filesystem is made smaller. So "compact" is effectively what occurs for imap in "mark as deleted" mode.

For maildir, if you use "delete to trash" mode and you delete a message, the message goes to trash mailbox and is removed from the "cur" directory on filesystem immediately. So, in that mode, the "compact" command does no filesystem changes and only does imap expunge.

So when the delete mode is "delete to trash" (and also probably "delete immediately") it would not be incorrect to change the command name from "compact" to "expunge". However, since historically "compact" has always been the choice, a lot of users wouldn't know what "expunge" is referring to. So I would vote to just keep it as "compact" for code simplicity and historical reasons.
Also, an imap expunge is also effectively a compacting process at the server since messages stored there that are marked deleted are deleted from the server resulting in less usage against any quota.

I do see that if you have Local Folders or a POP account (both with location URL starting with "mailbox://") using maildir, the option to "compact" doesn't appear in context menu or in top level "File" menu. This makes sense since mailbox:// accounts always delete messages into a Trash folder and there is no option to just mark a message as deleted.

Attachment #9357699 - Flags: approval-comm-esr115?

Comment on attachment 9357699 [details]
Bug 1827973 - Show "Compact" folder context item for imap accounts using maildir. r=mkmelin

[Triage Comment]
Approved for esr115

Attachment #9357699 - Flags: approval-comm-esr115? → approval-comm-esr115+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: