Open Bug 1093217 Opened 7 years ago Updated 2 years ago
Size for imap (size On Disk) is lost if panacea .dat is deleted
STR: 1) For an IMAP folder, delete panacea.dat prior to startup 2) Start Thunderbird Expected results: In Folder Properties, you see sizeOnDisk (which represents the size of the storage on the server) Actual results: sizeOnDisk is reported as zero. sizeOnDisk recovers if you rebuild the folder. This is also easier to see using the Extra Folder Columns extension, which displays folderSize.
Here's my fix. This uses existing patches from bug 813459 and bug 813249 which move folderSize to int64_t. This patch should be revisited and reviewed after those are resolved.
Assignee: nobody → kent
Status: NEW → ASSIGNED
Sorry for the wrong dependency
No longer depends on: 813249
To make this work correctly, we need to accurately keep track of a sum of the individual message sizes in the database. But folderSize is used in mbox as an indicator of db validity, and in that case (because of possible deleted messages) the folderSize may not equal the sum of the message sizes for individual messages. For both maildir (see bug 1032360) and in IMAP, we would like to have a dbFolderInfo variable that represents the sum of all of the messages sizes in the database. So it seems to me that the safest way to handle this will be to add a new variable to dbFolderInfo which represents the sum of message sizes, and add the hooks to properly maintain this variable as changes are made to the db. Then the folder can choose which representation it wants to report in the sizeOnDisk attribute. That will provide backwards compatibility, at the cost of confusing naming of various attributes: "sizeOnDisk" in the folder (which is what is reported in the UI), "folderSize" in dbFolderInfo and panacea.dat, and a new "totalSize" in dbFolderInfo and panacea.dat which is the sum of message sizes in the db. I'll have to try some code to see if all of this works or not.
I think the blocking bugs have landed, you can try continuing with this patch.
OS: Windows 8.1 → All
Hardware: x86_64 → All
Aceman, anything we should pick up? Anecdotal: Today I deleted my panacea.dat with the consequence that about 1000 MSF files got truncated to 0 bytes. http://kb.mozillazine.org/Files_and_folders_in_the_profile_-_Thunderbird says: panacea.dat - Mail folder cache. It can be safely deleted to resolve various issues. Well, I had heaps of problems after deleting it. Filters didn't work, all read indicators lost, etc.
see also bug 131589
You need to log in before you can comment on or make changes to this bug.