Prefactor nsMsgOfflineImapOperation
Categories
(MailNews Core :: Database, task)
Tracking
(Not tracked)
People
(Reporter: benc, Assigned: benc)
References
(Blocks 1 open bug)
Details
(Keywords: leave-open)
Attachments
(17 external files)
Offline IMAP operations (which - of course - are also used for some online operations ;- ) have a whole lot of quirks that deserve to be sorted out.
In particular, they have no concept of tracking IMAP UIDs separate to nsMsgKey which needs to be done for Bug 1806770.
But while we're here, it looks like it might be worthwhile to sort out some of the other oddities:
nsMsgOfflineImapOperation(the only implementation) is explicitly tied to a Mork database row. This is a showstopper for getting IMAP working with Panorama (the globaldb work).- Offline operations are indexed by
nsMsgKey. It's not clear if that was just a convenient unique ID or if it's actually also used to look up messages in the database (not always possible - for example, with offline deletes the local message is already gone). In any case, it definitely seems like offline operations should have their own database-assigned unique ID. Another showstopper for Panorama. - There's an
nsIMsgOfflineImapOperationinterface which handles all the different operation types, but it's not clear which attributes are used for which operations, or how to set up an offline operation (other than looking at what calling code currently does). - Creation and fetching is merged into a single function,
MailDatabase::GetOfflineOpForKey(), which may return a blank, uninitialised object, leaving it up to the caller to distinguish and deal with. - The operation types are bitflags rather than simple enumerations -
nsMsgOfflineImapOperation::SetOperation(nsOfflineImapOperationType aOperation)performs a bitwise OR to mergeaOperationwith whatever other value might be set. - The valid combination of operation bits is very murky and ill-defined.
Not quite sure of the shape of this yet.
My primary aims are to first support non-nsMsgKey UIDs properly and secondly to get to a point where it'll be possible to provide a Panorama implementation.
I think attempting a bit of refactoring is going to be the best way to actually understand this code, so that's where I'm going to start.
| Assignee | ||
Comment 1•3 months ago
•
|
||
Ahh. And nsImapOfflineDownloader inherits from nsImapOfflineSync.
There's not a lot of commonality there, and it makes nsImapOfflineSync much harder to refactor... maybe should it be split out into a simpler class of it's own rather than using inheritance... hmm...
| Assignee | ||
Comment 2•3 months ago
|
||
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/136c57adf76a
Remove unused nsIMsgOfflineImapOperation.numberOfCopies. r=tobyp
| Assignee | ||
Comment 4•3 months ago
|
||
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 5•3 months ago
|
||
| Assignee | ||
Comment 6•3 months ago
|
||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/6402f6b63663
Remove dead nsMsgFolderFlags::CreatedOffline flag and associated offline-sync code. r=tobyp
https://hg.mozilla.org/comm-central/rev/d54d7419f2a3
Remove redundant nsIMsgImapMailFolder.liteSelect(). r=tobyp
https://hg.mozilla.org/comm-central/rev/21105d09876a
Tidy up IMAP offline operation dispatching. r=tobyp
| Assignee | ||
Comment 8•3 months ago
|
||
| Assignee | ||
Comment 9•2 months ago
|
||
We need to refer to UIDs from various non-imap places, so may as well
define it in base rather than pretending we can hide it down in IMAP.
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/cce37c6cfa7c
Move the definition of ImapUid type into base. r=mkmelin
| Assignee | ||
Comment 11•2 months ago
|
||
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 12•2 months ago
|
||
The main aim here is to just try and note most of the numerous quirks
of nsIMsgOfflineImapOperation, in order to make it easier to replace
with something simpler and clearer and more robust.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 13•2 months ago
|
||
Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/19413942c04a
Add {fmt} support to nsIMsgOfflineImapOperation to ease debugging and logging. r=mkmelin
| Assignee | ||
Updated•2 months ago
|
Comment 16•2 months ago
|
||
Pushed by edicharry@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/fedb41d454cd
Comment only changes. Document nsIMsgOfflineImapOperation interface. r=mkmelin
https://hg.mozilla.org/comm-central/rev/7afa35ebd6d9
Add UID support to nsIMsgOfflineImapOperation for copy/move operations. r=mkmelin
| Assignee | ||
Comment 17•17 days ago
|
||
| Assignee | ||
Comment 18•17 days ago
|
||
| Assignee | ||
Comment 19•17 days ago
|
||
| Assignee | ||
Comment 20•16 days ago
|
||
| Assignee | ||
Comment 21•16 days ago
|
||
| Assignee | ||
Comment 22•15 days ago
|
||
| Assignee | ||
Comment 23•15 days ago
|
||
| Assignee | ||
Comment 24•15 days ago
|
||
| Assignee | ||
Comment 25•15 days ago
|
||
| Assignee | ||
Updated•14 days ago
|
| Assignee | ||
Comment 27•11 days ago
|
||
Thanks - rebased now, so should be good to go!
| Assignee | ||
Updated•11 days ago
|
| Assignee | ||
Updated•11 days ago
|
Comment 28•11 days ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/97120e314f40
Make nsIMsgOfflineImapOperation.sourceFolderUri read-only. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/f4fc9643862e
Add setter method for nsIMsgOfflineImapOperation kDeleteAllMsgs. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/e1dd5185ec32
Add setter methods for nsIMsgOfflineImapOperation kMsgMoved and kMsgCopy. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/157780fe5bb4
Add setter methods for nsIMsgOfflineImapOperation kAppendDraft. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/671bc17ccf51
Tidy up nsIMsgOfflineImapOperation methods for setting up kAddKeywords and kRemoveKeywords operations. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/0f3568ddf825
Fix mixups between nsIMsgOfflineImapOperation operation and imap flags. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/6d55648b0cc0
Replace misleading nsIMsgOfflineImapOperation.flagOperation method with a method to explicitly set up kAddKeywords ops. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/5787e26b8431
Make nsIMsgOfflineImapOperation.operation read-only. r=thunderbird-back-end-reviewers,babolivier
https://hg.mozilla.org/comm-central/rev/f703fa543f35
Replace nsIMsgOfflineImapOperation string uses with AUTF8String. r=thunderbird-back-end-reviewers,babolivier
Description
•