Open Bug 1783547 Opened 3 years ago Updated 1 year ago

Compacting inbox doesn't change size in properties (if message filter copied messages to that mbox)

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 102
defect

Tracking

(Not tracked)

People

(Reporter: emoore, Unassigned)

References

(Blocks 1 open bug)

Details

I'm using Thunderbird 102.1.1 (64-bit) under Windows 11Pro. I have a message filter that copies several messages from the inbox in my Fastmail IMAP account to the inbox in the Local Folders special account. Both use mbox files.

I selected tools -> message filters in my Fastmail account, selected a message filter that copies several messages to the inbox in "Local Folders" , pressed the run now button and exited the filter window. I noticed the status bar mention that several messages were copied. I selected several messages in the Local Folders inbox, deleted them, right clicked on the same accounts inbox in the folder pane and selected "compact" from the context menu.

Actual behavior:
Nothing happens. I verified the file size both in the folder column and by looking at the file size of the mbox file in file explorer. If I exit and restart Thunderbird and then compact the folder it works.

Expected behavior:
It would compact the folder. This would update the size column in the folder pane and the size of the mbox file in file explorer

I don't know that filters has anything to do with this.
Using beta 104.0b2, when I do a compact, and no other steps, the size reported doesn't change, despite the status bar saying "nn.nMB saved".
In my case, restarting doesn't help.

Flags: needinfo?(benc)
Summary: Compacting inbox does nothing if message filter copied messages to that mbox → Compacting inbox does change size in properties (if message filter copied messages to that mbox)
Summary: Compacting inbox does change size in properties (if message filter copied messages to that mbox) → Compacting inbox doesn't change size in properties (if message filter copied messages to that mbox)

My testing was due to somebody in the MozillaZine forums who reported that for version 102 if they used message filters to move messages to another folder in a POP account, deleted some messages and then tried to compact the folders it did nothing. Their workaround was to use repair folder. I couldn't reproduce it using IMAP accounts.

Repair folder didn't help when I managed to reproduce it using Local Folders. Exiting and restarting did. I asked them to try that and it didn't work for them. I have no clue why the filtering dependency but I've tried it five times and it occurred each time. I also looked at the contents of the mbox file in Local Folders to verify it wasn't corrupt.

I can't duplicate the problem with 105.0a1 (2022-08-06) (64-bit). On the other hand that Daily build has all sorts of errors such as trying to install an add-on using the search field in tools -> add-ons and themes downloads the file to the desktop (not even to the downloads folder) instead, and the spaces toolbar being yellow.

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

I don't know that filters has anything to do with this.
Using beta 104.0b2, when I do a compact, and no other steps, the size reported doesn't change, despite the status bar saying "nn.nMB saved".
In my case, restarting doesn't help.

I can't seem to replicate this on the latest code, either on IMAP or local folders. (I was using mbox and I didn't try any filter twiddling).

Was this IMAP? A patch landed a couple of days ago for Bug 1782374 might have some bearing on this?
"Compact" under IMAP implies and expunge, and the compact and expunge operations were racing somewhat. So there was a case where the compact would finish before the expunge actually marked any messages deleted.
That might explain the "nn-nMB saved" discrepancy?
The patch I did makes sure the expunge finishes first, then the compact is started. And the caller is informed when it's all done.

Flags: needinfo?(benc)
Blocks: tb102found

I just tested against my vseerror, imap "Drafts" folder:

  1. deleted a message
  2. thunderbird properties indicates a size of 40.2 KB, 7 messages
  3. compact folder, claims to have saved 60.9 KB
  4. properties still shows size of 40.2 KB, however Mac reports 33 KB / 30,132 bytes
Flags: needinfo?(benc)

(In reply to Ben Campbell from comment #3)

Was this IMAP? A patch landed a couple of days ago for Bug 1782374 might have some bearing on this?

Eric ^

Flags: needinfo?(emoore)

Yes, it was IMAP.

Flags: needinfo?(emoore)

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

I just tested against my vseerror, imap "Drafts" folder:

  1. deleted a message
  2. thunderbird properties indicates a size of 40.2 KB, 7 messages
  3. compact folder, claims to have saved 60.9 KB
  4. properties still shows size of 40.2 KB, however Mac reports 33 KB / 30,132 bytes

I assume that was with the fix landed in Bug 1782374 included, right?

I couldn't replicate it (latest code, IMAP, trying both inbox and drafts folder).

I did spot a little oddness in drafts: if I repeatedly click "save", it writes multiple copies of the message to the mbox file, while still showing only the single copy in the UI... but then I'd kind of guess that was desired behaviour - saving a draft should overwrite the previous version, which - in mbox-land - means appending a new copy...

Flags: needinfo?(benc)
See Also: → 1791354
You need to log in before you can comment on or make changes to this bug.