Multiple rename of Virtual folder causes loss of Virtual folder after restart, because Tb doesn't delete old ".msf" and Tb Trunk creates ".msf" file at different place (Virtual folder/Saved search under IMAP account only)

NEW
Unassigned

Status

defect
11 years ago
9 years ago

People

(Reporter: World, Unassigned)

Tracking

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

Spin off of phenomenon of Bug 370071 Comment #3.

Virtual folder is lost by restart, because Tb Trunk creates ".msf" file at different place from expected location (Virtual folder/Saved search folder under IMAP account only).
Tested Tb latest-trunk 2008/8/09 build on MS Win-XP SP3.
(1) Create virtual folder of "AB", and open "AB" (under IMAP account)
    => AB.msf was not created at expected location.
> virtualFolders.dat
>   uri=imap://Y-One@imap-gmail.mail.server/Label-A/AB
> AB.msf was created at (AB.sbd was not created) :
>   %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\AB.msf
> Expected location (where virtualFolders.dat points to) :
>   %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\<server_name>\Label-A.sbd\AB.msf
(2) Rename "AB" to "BC".
    => BC.msf was created at following, and property was lost.
>   %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\BC.msf
(3) After restart of Tb, virtual folder(saved search) was lost.
Above was result by mixture of "(a) garbage after rename(old .msf is not deleted)" + "(b) .msf file is not created until restart" + "(c) garbages at different location" + "(d) virtual folder is not displayed after restart".
Sorry for confusion.

Tb Trunks's behaviour was as follows.

(1) Create virtual folder of "AB", and open "AB" (under IMAP account)
      => AB.msf was not created at this step.
(2) Create virtual folder of "BC", and open "BC" (under IMAP account)
    => BC.msf was not created
    Rename "BC" to "CD" => CD.msf is not created. Property is lost, re-define.
    Rename "CD" to "DE" => DE.msf is not created. Property is lost, re-define.

(3) Restart Tb
> virtualFolders.dat
>   uri=imap://Y-One@imap-gmail.mail.server/Label-A/AB
>   uri=imap://Y-One@imap-gmail.mail.server/Label-A/DE
> (correct files)
%APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\<server_name>\Label-A.sbd\AB.msf
%APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\<server_name>\Label-A.sbd\DE.msf
> (garbage)
>   %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\BC.msf
>   %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\DE.msf
>   (no garbage for CD)

After restart of Tb, virtual folder(saved search) under IMAP account is not displayed(I thought "folder was lost"). Collapse/Expand of parent folder(Label-A in above case) is required to see virtual folders. Property is not lost.

(4) Rename original of "AB" several times
   (no check of "property loss or not here after)
(4-1) Rename "AB" to "PQ". PQ.msf is created(expected location)
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\<server_name>\Label-A.sbd\PQ.msf
(4-2) Rename "PQ" to "QR". QR.msf is created at different location.
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\QR.msf
(4-3) Rename "QR" to "RP". RP.msf is created at different location.
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\RP.msf

(5) Rename original of "BC"=>"CD"=>"DE" several times
   (no check of "property loss or not here after)
(5-1) Rename "DE" to "XY". XY.msf is created(expected location)
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\<server_name>\Label-A.sbd\XY.msf
(5-2) Rename "XY" to "YZ". YZ.msf is created at different location.
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\YZ.msf
(4-3) Rename "YZ" to "ZX". ZX.msf is created at different location.
> %APPDATA%\Thunderbird\Profiles\<profdir_name>\ImapMail\ZX.msf

(6) Following is expected virtualFolders.dat, but they are not found. 
> uri=imap://Y-One@imap-gmail.mail.server/Label-A/RP
> uri=imap://Y-One@imap-gmail.mail.server/Label-A/ZX

(7) Shutdown Thunderbird.
virtualFolders.dat is same as step (6)

(8) Restart Thunderbird. Following apperes under Label-A.
  XY (Virtual folder), AB (usual folder), DE (usual folder), PQ (usual folder)
  (Needless to say, "undefined older" error occurs, if AB/DE/PQ is clicked.)

(9) Click XY
    Search works, and AB,DE,PQ disappers. (Perhaps LIST SUB is issued)
    i.e. RP and ZY is lost, and XY revived.

Because no entry in virtualFolders.dat, it seems to depends on;
  (a) Label-A.sbd\??.msf exists or not
  (b) Folder of "??" is alive in folder cache or not
I guess;
Label-XY.sbd\XT.msf exists, and XY is probably alive in folder cache file,
then XY survives as Virtual folder, and property is recovered from XY.msf.

Some bug reports "loss of property", "inconsistent behaviour" etc. after rename of Virual folder. Above possibly can explain such phenomena.
Summary: Virtual folder is lost by restart, because Tb Trunk creates ".msf" file at different place from expected location ("Virtual folder"/"Saved search" under IMAP account only) → Multiple rename of Virtual folder causes loss of Virtual folder after restart, because Tb does't delete old ".msf" and Tb Trunk creates ".msf" file at different place (Virtual folder/Saved search under IMAP account only)
(Note-1)
No problem when all of next conditions meet:
(1) .msf file for folder exists. (restarted after Virtual folder creation)
(2) Rename of a folder is only once during single Thunderbird session.
(3) Oldname of any rename is not used as newname in any other rename of folder
    during single Thunderbird session.

(Note-2)
Even if garbage of oldname.msf remained(not deleted by Tb), it'll be deleted upon first connection to IMAP server after restart, because folder of "oldname" doesn't exists at IMAP server.

(Simplest workaround of multiple rename related problems on IMAP account:)
  - Define Virtual folder under (dummy) POP3 account or "Local Folders".
Summary: Multiple rename of Virtual folder causes loss of Virtual folder after restart, because Tb does't delete old ".msf" and Tb Trunk creates ".msf" file at different place (Virtual folder/Saved search under IMAP account only) → Multiple rename of Virtual folder causes loss of Virtual folder after restart, because Tb doesn't delete old ".msf" and Tb Trunk creates ".msf" file at different place (Virtual folder/Saved search under IMAP account only)

Comment 3

11 years ago
maybe related or not bug 459302
Not renaming, just dissapear .. but the msf is always there, mbox never ..
[I thought has something to do with bad location of folders/msf ..]
(In addition to comment #1)
> After restart of Tb, virtual folder(saved search) under IMAP account is not displayed(I thought "folder was lost"). 
> Collapse/Expand of parent folder(Label-A in above case) is required to see virtual folders.
> Property is not lost.

It was already known problem, Bug 364519.
Component: General → Backend
Product: Thunderbird → MailNews Core
QA Contact: general → backend
You need to log in before you can comment on or make changes to this bug.