Confirmed users
240
edits
m (→Analysis: details on specific calls) |
m (comments on overloading of folderSize definition) |
||
Line 85: | Line 85: | ||
As a general rule, changes to folder metadata is first written to dbFolderInfo without doing changes on the equivalent member variables in the msgFolder. The variables in the msgFolder are changed at the end of operations, reading from dbFolderInfo in ReadDBFolderInfo. | As a general rule, changes to folder metadata is first written to dbFolderInfo without doing changes on the equivalent member variables in the msgFolder. The variables in the msgFolder are changed at the end of operations, reading from dbFolderInfo in ReadDBFolderInfo. | ||
=== Overloaded meaning and definition of folderSize === | |||
One of the things that makes folderSize so complex is that its meaning is overloaded, with at least three different uses: | |||
* On local folders with mbox, folderSize is used to report to the UI the size of the message folder on disk, as well as used as an indicator of whether the summary file is valid. Although these values are the same, the timing issues on updates for these two issues may be different. | |||
* For maildir, calculating folderSize is slow directly from the disk, but it is not used as an indicator of validity of the message summary file. | |||
* On IMAP, the summary file is still used with offline folders, but the meaning of folderSize is changed to represent the server-side storage used for messages. For this reason, folderSize is unavailable for use with offline folders to represent the validity of the summary file. | |||
=== ReadDBFolderInfo(force) === | === ReadDBFolderInfo(force) === | ||
Line 109: | Line 119: | ||
This is just a synonym for UpdateSummaryTotals(false), and is only used in IMAP. Its main purpose seems to be to write folder metadata to the folder cache. This assumes that the metadata was written to dbFolderInfo at the time it was changed. One common use seems to be after ChangeNumPending... which does changes in dbFolderInfo and notifications but not in folderCache. The call to UpdateSummaryTotals(false) only flushes the changes to the folder cache. | This is just a synonym for UpdateSummaryTotals(false), and is only used in IMAP. Its main purpose seems to be to write folder metadata to the folder cache. This assumes that the metadata was written to dbFolderInfo at the time it was changed. One common use seems to be after ChangeNumPending... which does changes in dbFolderInfo and notifications but not in folderCache. The call to UpdateSummaryTotals(false) only flushes the changes to the folder cache. | ||
== folderSize and IMAP databases == | |||
For IMAP databases, folderSize has a different meaning, namely it represents our estimate of the server-side storage for messages in a folder. This is really valuable, for example, when you are approaching the disk storage limits of your IMAP folder and need to know where that space is being used. | |||
But it creates havoc with the overloaded meaning of folderSize. In local folders, |