Split nsImapOfflineDownloader from nsImapOfflineSync
Categories
(MailNews Core :: Database, task)
Tracking
(Not tracked)
People
(Reporter: benc, Assigned: benc)
References
(Blocks 1 open bug)
Details
Attachments
(3 external files)
nsImapOfflineDownloader currently inherits from nsImapOfflineSync, even though they don't really have any overlap in functionality.
They are both used when we go from offline to online:
nsImapOfflineSync - plays back any stored operations on IMAP folders that occurred while we were offline and need to be relayed up to the server.
nsImapOfflineDownloader - kicks off downloading messages to the local store (pausing the nsIAutoSyncManager which does the same thing, but in the background).
The only real commonality is potential traversal over all the folders, and even then there are special cases (eg nsImapOfflineDownloader is only interested in IMAP folder, while nsImapOfflineSync also needs to handle local folders (which might be targets for offline move/copy ops).
The inheritance makes both classes pretty incomprehensible (and makes refactoring offline ops really hard - Bug 2057063).
It'd be much simpler if they were completely separate classes, even if it means duplicating some folder-traversal code.
| Assignee | ||
Comment 1•3 months ago
|
||
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 2•3 months ago
|
||
| Assignee | ||
Comment 3•3 months ago
|
||
Notes to self, to help pick up the assorted threads needed to climb out of this rabbit hole next week:
So there's a patch which splits out nsImapOfflineDownloader.
But nsImapOfflineDownloader has no test coverage to verify it's working. So let's add a test before we split it out, so we can check before and after.
Looks like nsImapOfflineDownloader is used exclusively by nsIMsgOfflineManager.synchronizeForOffline(), so I've written a simple test which uses that.
Except that there isn't a way to tell when nsIMsgOfflineManager.synchronizeForOffline() is finished.
There is an nsIMsgOfflineManager.inProgress attribute you can poll, but that doesn't seem to work, so some more investigation is needed there (polling .inProgress works for some of the other tests, but not here - it just hangs).
Updated•3 months ago
|
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/0115a688b4f8
Add test_nsImapOfflineDownloader.js. r=tobyp
https://hg.mozilla.org/comm-central/rev/f9dd9e30db6e
Split nsImapOfflineDownloader out from nsImapOfflineSync. r=tobyp
| Assignee | ||
Comment 5•3 months ago
|
||
Doh - I screwed up and left a member variable uninitialised.
Thanks, ASAN!
https://treeherder.mozilla.org/jobs?repo=comm-central&selectedTaskRun=XVibuuWZSlWDTuwSyBmi-g.0
| Assignee | ||
Comment 6•3 months ago
|
||
| Assignee | ||
Updated•3 months ago
|
Pushed by toby@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/49bbf56aea06
Fix uninitialised member variable in nsImapOfflineDownloader. r=mkmelin
Description
•