Folder cache (folderCache.json) uses absolute path of the db file (.msf) as the per-folder key, which is needlessly tied to profile dir location.
Categories
(MailNews Core :: Database, task)
Tracking
(Not tracked)
People
(Reporter: benc, Unassigned)
References
(Blocks 1 open bug)
Details
Currently, nsMsgFolderCache usage uses the absolute file path of the .msf file to locate folder data in the folder cache, eg:
/home/timmytestuser/stuff/profile-default/ImapMail/imap.localhost/INBOX.msf
This is needlessly specific and means the folderCache data won't found if you move a profile to a new location on disk, or to a machine running a different OS.
I think just using the folder URI as key would sort address this nicely.
The trick is handling the migration. We don't have an up-front list of all the folders in advance, so we need to do it on-the-fly.
There are three places where the key is used (via nsIMsgFolderCache.getCacheElement()):
https://searchfox.org/comm-central/search?q=GetCacheElement&path=&case=true®exp=false
To migrate, these should:
- Look up the cacheElement using the the folder URI as key.
- if not found, try looking up the old key (the absolute filesystem path).
- if that was found, rename the key to the folder URI.
Actually, probably don't need to do this in all three places - just work out which one is used first (during folder creation) and do the migration there.
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•2 years ago
|
Description
•