Closed Bug 267345 Opened 20 years ago Closed 20 years ago

Deleted virtual folder in POP, RSS accounts reappears on restart

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird1.0

People

(Reporter: tracy, Assigned: Bienvenu)

References

Details

(Keywords: fixed-aviary1.0)

Attachments

(1 file)

Seen on Windows XP TB build 2004-11-01-14-0.9

-Create a virtual folder of the inbox of a POP account (something simple like
Label is Work from the Views menu)
-Context click on the newly created virtual folder and select Delete Folder. The
folder appears to be gone
-Restart TB. The folder still appears to be gone.
-Recreate the same virtual folder as before. During recreation, a warning
appears; "A folder with that name already exists. Please enter a different
name." Dismiss it with Okay.  Click cancel or okay to dismiss the virtual folder
creation dialog.

also,
-Restart TB.  
The folder appears. Context click the folder and select Properties. There aren't
any criteria nor is a search folder selected.
Note: This doesn't affect deleting of virtual folders on IMAP.
also occurs for virtual folders created in RSS accounts.
OS: Windows XP → All
Hardware: PC → All
Summary: Deleted virtual folder in POP accounts reappears on restart. → Deleted virtual folder in POP, RSS accounts reappears on restart
would it be possible to fix this for 1.0?
Target Milestone: --- → Thunderbird1.0
I am seeing this too with version 0.9 (20041103).  I cannot seem to delete
virtual folders in my imap account.  

Simply deleting them through button or menu removes it from the ui, but it comes
back on restart.  

Drag and drop into trash shows confirmation dialog and puts it in the
trash...and after emtpying trash and restart, the folder is gone from the UI.
But I see the following behavior:
  - If I try to create a new virtual folder with the same name, clicking Ok in
the "New Saved Search Folder" dialog does nothing the first time.
  - If I click Ok a second time, it says the it cannot be created, try another name.
  - After canceling out of the dialog, the folder is not shown in the UI
  - After restart the folder is there again!
OS: All → Windows XP
Hardware: All → PC
Target Milestone: Thunderbird1.0 → ---
Err, I meant in my POP mail account folders.  I don't have IMAP, sorry.
I also saw this on the mac while testing the version 0.9 (20041103) bits tonight.
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Thunderbird1.0
What will happen after next procedure?
 (1) Shutdown Thunderbird
 (2) Delete panacea.dat in profile directry
 (3) Delete <Virtual Folder Name> and <Virtual Folder Name>.msf file if exists
    ( and <Virtual Folder Name>.sbd directry if exists ) from mail directry
 (4) Restart Thunderbird
 (5) Try to create previously used "Save Search Folder" again

Note:
Do NOT try to define "Save Search Folder" as subfolder of other folder instead
of as first level folder of POP3 account.
See Bug 267373 for problems when tried to create "as subfolder".
This might be the same problem as I described in bug 267890:

When you delete a virtual folder than TB didn't delete all data of that folder
in your profile. 

Data is stored in virtualFolders.dat, panacea.dat and in the mail-folder. The
data in virtualfolders.dat and in the mail-folder is deleted but not in
panacea.dat. When you want to create a new virtual folder with the same name
than TB give the message "Virtual Folder already exists".
*** Bug 267890 has been marked as a duplicate of this bug. ***
panacea.dat is most likely irrelevant to this problem. The problem is much more
likely to be that the .msf file is left around.
David, I think the panacea.dat has something to do with the problem. I tested a
little bit more:

1. Create a new virtual folder "test"
   - msf-file is created
   - panacea-entry is added
   - virtualFolder.dat-Entry is added

2. Delete virtual folder "test"
   - msf-file is deleted
   - panacea-entry is NOT deleted
   - virtualFolder.dat-Entry is deleted

3. Want to create a new virtual folder "test" again
   - Messagebox "... already exists ..." pop up
   - msf-file IS created
   - panacea-entry still exist
   - virtualFolder.dat-Entry doesn't exist

Now you have both, panacea and msf-file, but before you want to create the
folder another time there is only the panacea-entry left and if you delete it
manualy before creating the folder a second time, than you are able to do it.
(In reply to comment #10)
> panacea.dat is most likely irrelevant to this problem. The problem is much more
> likely to be that the .msf file is left around.

David, I think following problems are caused by garbage of in memory panacea.dat
data. (Different but similar to Bug 65303, folder rename problem)
Problems in my test are ;
 (A) Problem in step (6)
     Re-creation after delete is impossible.
       - "OK" button was disabled.
       - Nothing happened when clicking "Choose" button.
 (B) Problem in step (11)
     Re-creation after delete fails.
       - On first click of "OK", nothing happened but "test" was created.
         "test.msf" file was not created.
       - Because of existence of folder file("test" only),
         second and following "OK" fails with "already exists" error.
 (C) Problem in step (12)
     Virtual folder appears again after restart,
     because of existence of folder file("test" only).

[Test scenarioo and result (Thunderbird latest-trunk version 0.6+ (20041103)]

(1) Delete panacea.dat,virtualFolders.dat in profile directry
(2) Delete test and test.msf in Mail directry if exists
(3) Start Thunderbird
(4) File/New/Saved Search and create virtual folder of "test"
    => test and test.msf were created
         2004/11/07  05:19                    0 test
         2004/11/07  05:19                1,371 test.msf
         2004/11/07  05:19               10,459 panacea.dat
         2004/11/07  05:19                  192 virtualFolders.dat
(5) Delete virtual folder of "test"
    => test and test.msf were deleted from mail directry
         2004/11/07  05:19               10,459 panacea.dat
         2004/11/07  05:25                   10 virtualFolders.dat
(6) File/New/Saved Search
   (6-1) Enter "test" as folder name
   (6-2) Fill condition
         "OK" is grayed out   
   (6-3) Click "Choose" button of "Select the folders to search"
         Nothing happened ("OK" is still grayed out)
   (6-4) Click "Choose" button again again
         Nothing happened ("OK" is still grayed out)
         (test and test.msf doex not exist)
         (next files are not changed)
         2004/11/07  05:19               10,459 panacea.dat
         2004/11/07  05:25                   10 virtualFolders.dat
   (6-5) Click "Cancel"
(7) Shutdown Thunderbird
    (test and test.msf doex not exist)
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:37                   10 virtualFolders.dat
(8) Restart Thunderbird
    (test and test.msf doex not exist)
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:37                   10 virtualFolders.dat
(9) File/New/Saved Search
   (9-1) Enter "test" as folder name
   (9-2) Fill condition
         "OK" button is enabled.
   (9-3) Click "Choose" button of "Select the folders to search"
         => Could choose folder to search
   (9-4) Click "OK"
         => test and test.msf were crated
         2004/11/07  05:45                    0 Test
         2004/11/07  05:45                1,457 Test.msf
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:45                  192 virtualFolders.dat
(10) Delete virtual folder of "test"
     => test and test.msf were deleted from mail directry
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:47                   10 virtualFolders.dat
(11) File/New/Saved Search
   (11-1) Enter "test" as folder name
   (11-2) Fill condition
         "OK" button is enabled.
   (11-3) Click "Choose" button of "Select the folders to search"
         => Could choose folder to search
   (11-4) Click "OK"
         => Nothing happened
            But test was created!
            However, test.msf was NOT created
         2004/11/07  05:49                    0 test
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:47                   10 virtualFolders.dat
   (11-5) Click "OK" again
         => Error message was displayed
              A folder with the name already exists.
              Please enter a different name.
         => "test" still exists. "test.msf" does not exists.
         2004/11/07  05:49                    0 test
         2004/11/07  05:37               11,051 panacea.dat
         2004/11/07  05:47                   10 virtualFolders.dat
   (11-6) "Cancel" virtual folder creation
(12) Shutdown and Restart Thunderbird
     => folder of test appears (this was virtual folder)
        because test.msf was recovered form test
         2004/11/07  05:49                    0 test
         2004/11/07  05:59                1,131 test.msf
         2004/11/07  05:59               10,506 panacea.dat
         2004/11/07  05:59                   82 virtualFolders.dat
     => Contents of virtualFolders.dat
          version=1
          uri=mailbox://test@test.test.test/test
          scope=
          terms=
          searchOnline=false
(End of test result)

passing the buck
Assignee: mscott → bienvenu
Attached patch proposed fixSplinter Review
1. when loading and saving virtualfolders.dat, ignore virtual folders that are
empty/blank (e.g., no uri)
2. rebuild panacea.dat on shutdown, if a folder has been deleted (we were
leaving entries around for deleted folders, which were normally ignored,  but
when you tried to create a new one, we found a cache entry for the old deleted
one and got a bit confused)

while looking at this, I found a lot of files like Inbox-XX.msf - so I've
included a fix to remove imap .msf files that don't have a valid hierarchy
delimiter, to clean up those .msf files.
Attachment #165328 - Flags: superreview?(mscott)
(In reply to comment #14)
> 2. rebuild panacea.dat on shutdown

David, is it effective on "in-memory" panacea.dat data?

I think it will resolve problem in step (11) and (12) in my Comment #12.
But how about for problem in step (6)?
This is apparentry not caused by panacea.dat on hard disk, "in-memory"
data("cache" in your description?) instead.
Oh sorry, I'm comfused.
Problem in step (6) will be resolved by your "1." on virtualfolders.dat.
Sorry again for spam.
Comment on attachment 165328 [details] [diff] [review]
proposed fix

white space issue with:

+  void Clear();
Attachment #165328 - Flags: superreview?(mscott) → superreview+
Using Thunderbird 0.9 (20041103):

Accidentally reproduced entire problem with one caveat:

I deleted the saved search folder and created a new folder (not saved search)
with a different name - let's say test as the saved search and test1 as the new
folder.  I experienced all problems as described by this bug including the
inability to create a folder with the same name as the saved search.

I then filtered mail into test1.  Following this, I decided to be exceptionally
crafty and rename test1 to test, thinking that the data from test1 would force
an overwrite of the saved search data.  No overwriting occured and all mail that
had been filtered into test1 was irrevocably lost.
(In reply to comment #18)
David Meiser, rename problem is Bug 65303.
Because panacea.dat will be re-constructed when shutdown by path for this bug,
window that Bug 65303's problem occurs will be expected to be minimized.
(See Comment #14)
Calm down, and wait for patch check-in for this "Delete/re-define of virtual
folder" problem, please.
fix checked in...
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: fixed-aviary1.0
Resolution: --- → FIXED
Tested with THunderbird latest-trunk nightly 2004/11/10 build(Win-2K).

Some problems have been fixed and situiation is improved very much, but some
problems are not resolved yet.

(1)Deleted folder entry (.msf data) in panacea.dat was not deleted when shutdown
   just after delete. One more shutdown was required to delete from panacea.dat.
   (1-1) Define a folder (usual local mail folder of a POP3 account)
   (1-2) Shutdown and restart (To avoid affect by in-memory panacea.dat)
   (1-3) Delete the folder
   (1-4) Shutdown => entry of the folder(.msf) in panacea.dat was not deleted.
   (1-5) Restart and Shutdown => entry in panacea.dat was deleted.

(2) Problem at step (6) still exists. (Same status as before patch)

(3) Problem at step (11) was improved.
    Strange behaviour at step (11) disappeared.
    After patch, step (11) became same as step (6),
    can not create folder again because "OK" button is grayed out until restart.

Your patch's action "1." and "2." in Comment #14 worked very well, I think.
But "in-memory panacea.dat entry(cached panacea.dat?)" seems to disturb
both re-defining just after delete at step (6) and your patch's action "2.".
(I guess this is also the main cause of Bug 65303)
David, could you analyze this?
  
(In reply to comment #21)
> Tested with THunderbird latest-trunk nightly 2004/11/10 build(Win-2K).
> 
> (2) Problem at step (6) still exists. (Same status as before patch)
> 
> Your patch's action "1." and "2." in Comment #14 worked very well, I think.
> But "in-memory panacea.dat entry(cached panacea.dat?)" seems to disturb
> both re-defining just after delete at step (6) and your patch's action "2.".
>   

I can confirm this.
Tested with Thunderbird latest-trunk nightly 2004/11/11 build(Win-XP).

Also the mail-list isn't refreshed if you delete the virtual-folder (right-click
on folder -> select delete). The folder is gone but the mails are still there
until you select another folder.

Correction of test case (1) in my comment #21 (panacea.dat entry after delete)
based on re-test with Thunderbird latest-trunk nightly 2004/11/13 build,Win-2K)

If usual folder, panacea.dat entry of deleted mail folder was deleted by
shutdown when "Empty Trash" was executed.
If "Empty Trash" was not done, panace.dat entry was kept.
I think this is design.

I think problem on virtual folder deletion is ;
 - Delete operation of virtual folder does not execute 'Empty Trash' operation
   even though he physically deletes folder file.
And I guess this is the reason why two shutdowns are required to clear
panacea.dat entry for deleted virtual folder.

David, what do you think?
Problem described in summary, "deleted virtual folder reappears on restart", has
been resolved, but problem in deletion of virtaul folder still exist, then this
 causes re-define failure just after delete, as comment #21, comment #22 and
comment #23 says.
David, should we open new bug for this problem?
Maybe I should reopen bug 267890 ?
*** Bug 271189 has been marked as a duplicate of this bug. ***
*** Bug 231941 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: