Remove folder lookup service (nsIFolderLookupService)
Categories
(MailNews Core :: Backend, task)
Tracking
(Not tracked)
People
(Reporter: benc, Unassigned)
References
(Blocks 1 open bug)
Details
Folder discover and creation needs a lot of tidying up. Folder creation should be handled by asking a parent folder to create a child... not indirected through the FLS. If nothing else, it makes it really hard to track the flow of code.
nsIFolderLookupService
has two functions:
getFolderForURL
: this should be moved onto the account manager, and search by looking through folders on the nsIIncomingServers. i.e by looking through folders which exist and are valid and part of the folder hierarchy.getOrCreateFolderForURL
: this is a hangover from the now-gone RDF system, and shouldn't exist. Folders should be created by their parents (or by the nsIIncomingServer, in the case of root folders).
The FLS currently maintains an internal lookup cache, but this is just to handle dangling (parentless, non-root) folders. And once our folder discovery/creation is more sane, dangling folders would no longer be required.
First step is to replace all uses of:
nsIFolderLookupService.getOrCreateFolderForURL()
- the C++ helper
GetOrCreateFolder()
- the JS helper
MailUtils.getOrCreateFolder()
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 1•1 year ago
|
||
In Bug 1838672, @darktrojan said:
A virtual folder can be modified during an OnFolderAdded notification, but the (real) added folder
may not yet exist in the folder lookup service. When the folder tree is notified of the virtual
folder change, it asks the folder lookup service for the folders, so they need to exist.
Description
•