Open Bug 1930003 Opened 26 days ago Updated 9 days ago

Localfolders should use `.offlineMessageSize` and the `Offline` flag, same as IMAP.

Categories

(MailNews Core :: General, task)

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

References

Details

On IMAP .messageSize is the size of the message as reported by the server. .offlineMessageSize is the size as written into the msgStore. And the message Offline flag needs to be set.
For local folders, .offlineMessageSize is not used, nor is the Offline flag. And .messageSize is used for the size of the message data written into the store.

I think the correct uses for all folder types should be:

  • The Offline flag should be set if there is a copy of the message in the local store.
  • .offlineMessageSize should hold the size of the message as written to the local store. It should be the exact number of bytes to expect when you read the message back out out of the msgStore (NOTE: this is not the same as the size on disk. mbox encoding can add some bytes).
  • .messageSize is a bit fuzzier. I think it's probably best to think of it as the size of the message as far as the user cares. Maybe we should add a separate .serverMessageSize, and .messsageSize doesn't hold it's own value - it just returns .offlineMessageSize or .serverMessageSize based on if we've got a local copy or not.

Note also the gmail message-appearing-in-multiple-folders hack - see https://bugzilla.mozilla.org/show_bug.cgi?id=1764857#c4

For extra comedy value, I just discovered there is also an onlineSize size attribute, used by POP3 :-)

It's set by the pop3sink. The idea is that POP lets us download just the headers and first 10 or so lines from the body of a message.
In this case, such messages have the Partial message flag set, and onlineSize is the size of the full, raw message as reported by the server,
whereas .messageSize holds the size of the truncated message we downloaded and wrote to the msgStore.
I don't think .offlineMessageSize is used at all on POP messages.

You need to log in before you can comment on or make changes to this bug.