nsMsgFolderCacheElement key is not updated when folder is moved
Categories
(Thunderbird :: Folder and Message Lists, defect)
Tracking
(Not tracked)
People
(Reporter: benc, Assigned: benc)
References
(Blocks 1 open bug)
Details
(Keywords: leave-open)
Attachments
(1 file)
When folders are moved, their old nsMsgFolderCacheElement
entry is left dangling, and they must populate their cache entries again from scratch. This is because the path to the messageDB file is used as the key (see Bug 1726660).
Conceptually, this is an easy fix: when a folder is moved, the cache entry should also be moved (i.e. it's key should be updated).
In practice it's a little more messy, as folder management is a bit... ad-hoc.
Folder moves are usually initiated via the nsMsgCopyService
, but that just delegates the work to the individual folder, by calling nsIMsgFolder.copyFolder()
, so that's where we need to update the key.
For local folders (nsMsgLocalMailFolder
), the copy operation is shunted off to CopyFolderLocal()
or CopyFolderAcrossServer()
.
For IMAP (nsImapMailFolder
), moves are handled in RenameClient()
.
I didn't dig into News or RSS, but they will also need updating.
So those functions will need to also need to rename the nsFolderCacheElement
.
The way the folders access their nsFolderCacheElement
is pretty verbose and repeated in lots of places - I'd recommend that this stuff should be factored out into one place first. That'll make it much simpler, and be a great help when we go to change how the key is calculated (Bug 1726660).
Then I'd add a key-renaming method to the cache class (either the overall nsMsgFolderCache
or directly to nsMsgFolderCacheElement
).
At that point, adding code in the nsIMsgFolder.copyFolder()
implementations to update the key becomes very short and simple.
Probably, actual folder copies (not moves) should also have some handling added to copy the cache element... haven't thought too much about the issues there. Moving is the priority (because Bug 1846550 depends upon it).
Assignee | ||
Comment 1•7 months ago
|
||
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Comment 2•7 months ago
|
||
That's the first part of it. Next bit is to update the folder-copy routines to update the folderElementCache.
Updated•7 months ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/33a60b2649f4
Support renaming of nsIMsgFolderCacheElement objects. r=mkmelin
Description
•