Closed Bug 520437 Opened 17 years ago Closed 3 months ago

Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd (and {foldername}-{suffix} also, if offline-use=ON) is created upon each unsubscribe / subscribe. For example Inbox-1

Categories

(MailNews Core :: Database, defect)

1.9.1 Branch
Desktop
All
defect

Tracking

(thunderbird_esr140 wontfix, thunderbird_esr153 affected, thunderbird154 wontfix, thunderbird155 affected)

VERIFIED FIXED
156 Branch
Tracking Status
thunderbird_esr140 --- wontfix
thunderbird_esr153 --- affected
thunderbird154 --- wontfix
thunderbird155 --- affected

People

(Reporter: World, Assigned: welpy-cw)

References

Details

Attachments

(1 external file)

Garbage file/directory of {foldername}-{siffix}.msf and {foldername}-{siffix}.sbd is created upon each unsubscribe / subscribe. [Build Id] > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4pre) Gecko/20090930 Shredder/3.0pre [Steps to reproduce] (1) FolderA is subscribed. (offline use=on), FolderA.msf / FolderA is used. (2) Unsubscribe FolderA. FolderA.msf / FolderA is deleted. (3) Subscribe FolderA. FolderA.msf, FolderA-1.msf is created. FolderA-1.msf / FolderA-1 is used. (4) Unsubscribe FolderA. FolderA-1.msf / FolderA-1 is deleted. FolderA is not deleted. (5) Subscribe FolderA. FolderA-1.msf, FolderA-2.msf is created. FolderA-2.msf / FolderA-2 is used. (6) Unsubscribe FolderA. FolderA-2.msf / FolderA-2 is deleted. FolderA-1 is not deleted. (7) Subscribe FolderA. FolderA-2.msf, FolderA-3.msf is created. FolderA-3.msf / FolderA-3 is used. (8) Unsubscribe FolderA. FolderA-3.msf / FolderA-3 is deleted. FolderA-2 is not deleted. => garbage file increases infinitely. If FolderA has FolderA/SubFolderB, and both FolderA and FolderA/SubFolderB is unsubscibed, FolderA.sbd(FolderA-1.sbd, FolderA-2.sbd, ...) is not deleted. So garbage directory also increases infinitely.
Summary: Garbage file/directory of {foldername}-{siffix}.msf and {foldername}-{siffix}.sbd is created upon each unsubscribe / subscribe → Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd is created upon each unsubscribe / subscribe
On some accounts I have seen the number of Sent folders increase above 200! I will now try and switch off "show only subscribed folders" in the preferences to see, if that helps from creating that amount of garbage in the ImapMail folders.
These file names with suffix are kept in panacea.dat. To recover from garbages of file with suffix, "delete panacea.dat and restart Tb" is simplest operation, although it invokes re-fetch of all headers and re-sync of all mail data. With Gecko/20100617 Shredder/3.2a1pre, following messages was observed at Activity Manager. > Deleted folder A-1(and for A-10, A-11, A1, ... , A-9 because I created till 11) > The current operation on 'A' did not succeed. > The mail srver for account xxx@x.y.z responded: > Unknown Mailbox: ABCDEFG^A (Failure) The "^" instead of "/"(folder hiearchy delimiter) is known phenomenon but cause is still unknown.
"Unknown Mailbox: ABCDEFG^A (Failure)" may be relevant to next. > http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapIncomingServer.cpp#1067 > 1068 // Make sure the imapmailfolder object has the right delimiter because the unsubscribed > 1069 // folders (those not in the 'lsub' list) have the delimiter set to the default ('^').
foldername-suffix.msf was observed by next test. 1. Requet subscribe then pull off LAN cable => Connection error, blank subsciption list. 2. Plug in LAN cable, sow subscription list aain, OK, access some folders => foldername-suffix.msf. Error of SUBSCRIBE command looks to change or clear subscription list.
Blocks: 545210
Summary: Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd is created upon each unsubscribe / subscribe → Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd (and {foldername}-{suffix} also, if offline-use=ON) is created upon each unsubscribe / subscribe
I unknowingly created a new Bugzilla report that describes the same issue: https://bugzilla.mozilla.org/show_bug.cgi?id=698321
Suffix itself was produced simply by "xxx.msf already exists when Tb tries to use xxx.msf for IMAP folder named xxx". Check with Yahoo!'s IMAP server, because case sensitive IMAP folder name is supported, using Tb 8 on MS Win XP which uses case insensitive file name in file system but case of actual file name is kept. (A) When "same folder name if case insensitive check" already exists. Created IMAP folder IMAP folder at server Local file name used by Tb ABC ABC ABC.msf Abc Abc Abc-1.msf aBc aBc aBc-2.msf abC abC abC-3.msf (A) When "same folder name if case insensitive check" doesn't exist, but .msf file for it already exists. Created IMAP folder IMAP folder at server Local file name used by Tb Abc-1 Abc-1 Abc-1-1.msf Abc-1-1 Abc-1-1 Abc-1-1-1.msf Abc-1-1-1 Abc-1-1-1 Abc-1-1-1-1.msf Abc-1-1-1-1 Abc-1-1-1-1 Abc-1-1-1-1-1.msf I didn't check result when aBc-1, aBc-1-1, ... is created, abC-1, abC-1-1, ... is created. In any case, algorythm looks like next. If .msf file for created and/or subscribed IMAP folder already exists, try to use file name of <folder_name>-1.msf If .msf file named <folder_name>-N.msf already exists, try to use file name with increased suffix, <folder_name>-{N+1}.msf I don't know about "maximum N" used by Tb. Problem and cause of suffix in unsubscribe/re-subscribe is creation of previously used .msf file upon re-subscribe of folder at step (3), step (5), and step (7), in following STR. [Steps to reproduce] (1) FolderA is subscribed. (offline use=on), FolderA.msf / FolderA is used. (2) Unsubscribe FolderA. FolderA.msf / FolderA is deleted. (3) Subscribe FolderA. FolderA.msf, FolderA-1.msf is created. FolderA-1.msf / FolderA-1 is used. (4) Unsubscribe FolderA. FolderA-1.msf / FolderA-1 is deleted. FolderA is not deleted. (5) Subscribe FolderA. FolderA-1.msf, FolderA-2.msf is created. FolderA-2.msf / FolderA-2 is used. (6) Unsubscribe FolderA. FolderA-2.msf / FolderA-2 is deleted. FolderA-1 is not deleted. (7) Subscribe FolderA. FolderA-2.msf, FolderA-3.msf is created. FolderA-3.msf / FolderA-3 is used. (8) Unsubscribe FolderA. FolderA-3.msf / FolderA-3 is deleted. FolderA-2 is not deleted.
Blocks: 707446
Blocks: 131589
Kinda sucks, because I think I have a situation resulting from a) subscribe+unsub, and b) something else. It would be easier to understand b) if a) didn't exist. Is it truly solvable?
Flags: needinfo?(acelists)
See Also: → 698321
Sorry I can't comment on IMAP. I do not use it with production accounts. The few test accounts I have setup are on unverified servers (I do not know if they work properly or not) so when I let test TB check them from time to time I always get some mess (e.g. disappearing folders, connection timeouts, etc.)
Flags: needinfo?(acelists)
Severity: normal → S3
Summary: Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd (and {foldername}-{suffix} also, if offline-use=ON) is created upon each unsubscribe / subscribe → Garbage file/directory of {foldername}-{suffix}.msf and {foldername}-{suffix}.sbd (and {foldername}-{suffix} also, if offline-use=ON) is created upon each unsubscribe / subscribe. For example Inbox-1

Subscribing to an IMAP folder that isn't on disk yet used to create an
empty summary (.msf) file as a side effect. Building the subscribe URL
reads folder info - the hierarchy delimiter in ChangeFolderSubscription
and modseq/UID state in SetupWithUrl - and those info reads went through
ReadDBFolderInfo()/GetDBFolderInfoAndDB(), which open the summary
database and create it if missing. When discovery later creates the real
summary file, the premature empty one is renamed with a "-1" suffix
(leaving a NotOnDisk-1.msf duplicate behind) or ends up orphaned.

The hierarchy delimiter is a folder-cache property (hierDelim), not a
database property, so GetHierarchyDelimiter() doesn't need the database
at all. Add a cacheOnly mode to ReadDBFolderInfo() that only reads the
folder cache and never opens or creates a summary file, and use it in
GetHierarchyDelimiter(). SetupWithUrl() only needs to peek at existing
database state, so switch it to OpenFolderDB() instead of
GetDBFolderInfoAndDB().

Add a regression test that subscribes to a folder that isn't on disk yet
and verifies that discovery creates exactly one summary file for it,
without a "-1" duplicate left behind.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Blocks: 2060763
OS: Windows XP → All
Hardware: x86 → Desktop
See Also: → 1921694
Target Milestone: --- → 156 Branch

Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/f582b42e83e5
Don't leave a duplicate summary file behind when subscribing to an IMAP folder. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
No longer blocks: 707446
See Also: → 707446

Confirming this issue as verified fixed on Windows 11, macOS 26 and Ubuntu 26 using the latest Daily build 20260817095217

Status: RESOLVED → VERIFIED
Duplicate of this bug: 1816280
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: