Renaming folder creates duplicate, deleting duplicate deletes BOTH

RESOLVED WORKSFORME

Status

Thunderbird
Folder and Message Lists
RESOLVED WORKSFORME
5 years ago
10 months ago

People

(Reporter: Nigel Foster, Unassigned)

Tracking

17 Branch
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36

Steps to reproduce:

A) A folder named "SUPPLIER" was renamed "Supplier"
B) Attempted to delete folder named "SUPPLIER" when unexpected duplicate generated as a result of following step A


Actual results:

A) Mozilla created a DUPLICATE folder called "Supplier"
B) Mozilla deleted both "SUPPLIER" and "Supplier" folders


Expected results:

A) Folder "SUPPLIER" should have been renamed "Supplier" without creating duplicate
B) Folder "SUPPLIER" should have been deleted, but folder "Supplier" should not have been.  Further, there was no prompt "YOU ARE ABOUT TO DELETE A FOLDER WHICH CONTAINS SOMETHING.  ARE YOU SURE?  Y/N"
(Reporter)

Comment 1

5 years ago
Version 17.0.7
This is not an isolated incident.

Comment 2

4 years ago
I can definitely confirm this as a very real BUG.

I have had to restore folders from backups that got deleted this way at least 5 times in the last few months.

Wish I could change the status to CONFIRMED for you...

Comment 3

2 years ago
WFM, of a sort, using currrent nightly build on win7.
ABC - > abc give me "already exists", So I cann't do the first step of rename
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Component: Untriaged → Folder and Message Lists
Resolution: --- → WORKSFORME

Comment 4

2 years ago
Yes, renaming a folder to a different case does not really work, we have bug 92165 for that.

What kind of account are you guys using where this is possible?

Updated

2 years ago
Status: RESOLVED → UNCONFIRMED
Flags: needinfo?(tanstaafl)
Flags: needinfo?(nigelfoster1969)
Resolution: WORKSFORME → ---

Comment 5

2 years ago
When working with Local Folders, I now consistently get the error about a folder already existing with the same name, so I would consider this resolved for Local Folders.

But I am getting very inconsistent behavior with IMAP accounts.

Once, and only once, it actually worked - the rename happened quickly, and the original folder was gone and the newly renamed folder seemed to work properly.

When I tried it a second time, I ended up with two folders, the original, and a new one with the corrected case name. When I deleted one, it deleted both.

But when I tried it a third time, I noticed a 'Deleted folder 'originalname' message in the statusbar (lower left), but the original was still showing, and clicking on it seemed to work normally, although sometimes I got the little swirly 'wait I'm doing something' cursor and would get another statusbar message that the folder was deleted - but weirdly, a few minutes later, I clicked on it again and it disappeared (and did not show up in the Trash)...

So, behavior with IMAP accounts is still very wonky.
Flags: needinfo?(tanstaafl)

Comment 6

10 months ago
Charles, does this reproduce with 52.0b3?
http://www.mozilla.org/en-US/thunderbird/channel/
Flags: needinfo?(nigelfoster1969) → needinfo?(tanstaafl)
> Bug Summary : Renaming folder creates duplicate, deleting duplicate deletes BOTH

Why can it be *DUPLICATES"?

File named "SUPPLIER" == file named "Supplier" or File named "SUPPLIER" != file named "Supplier" depends on case sensitivity of file system.
  File named "SUPPLIER" == file named "Supplier" on MS Window's file system.
  File named "SUPPLIER" != file named "Supplier" on *nix(including Berkley used by Mac OS X)
                                                 (I don't know about Finder of Mac)
This is applicable to file system on IMAP server too, for example
  imap.mail.yahoo.com(xxx@yahoo.com, xxx@rocketmail.com are mail-addr/username used by Yahoo!)
File system of imap.mail.yahoo.com is perhaps case sensitive.
- Mbox named "SUPPLIER" != mbox named "Supplier" in imap.mail.yahoo.com
- Mbox named "SUPPLIER" != mbox named "supplier" in imap.mail.yahoo.com
- Mbox named "Supplier" != mbox named "supplier" in imap.mail.yahoo.com
So, three different mbox is created by "create SUPPLIER", "create Supplier", "create supplier", if imap.mail.yahoo.com.

On MS Windows(Thunderbird on MS Win is used in your case), file system is case insensitive, although case of file name is kept by create file, rename file etc. on MS Win
- File named "SUPPLIER" == file named "Supplier" on MS Windows
- File named "SUPPLIER" == file named "supplier" on MS Windows
- File named "Supplier" == file named "supplier" on MS Windows

For this kind of mismatch between file system on MS Win and imap server, Thunderbird appends suffix to local file name on case insensitive OS for the case sensitive mbox name at imap server.
- When mbox named "SUPPLIER" is created first, Thunderbird uses file named "SUPPLIER.msf" for it.
- When mbox named "Supplier" is created, Thunderbird uses file named "Supplier-1.msf" for it,
  because "SUPPLIER.msf" == "Supplier.msf" on MS Win.
- When mbox named "supplier" is created,  Thunderbird uses file named "supplier-2.msf" for it,
  because "SUPPLIER-X.msf" == "supplier-X.msf" and "Supplier-Y.msf" == "supplier-Y.msf" on MS Win.
"Mbox name of SUPPLIER, Supplier, supplier" is held in SUPPLIER.msf, Supplier-1.msf, supplier-2.msf file, and is shown at folder pane, Folder Properties.
In IMAP, "rename SUPPLIER to Supplier" is semantically identical to "create Supplier, remove SUPPLIER, copy mbox content".

You can see above easily by following.
0. Enable IMAP logging(NSPR logging) of Thunderbird.
   Unchek "Show subscribed folders only" to avoid unwanted issues due to case sensitive/insensitive in LSUB response.
1. Create top level Mbox named Test at the relevant imap account.
2. Under Test folder, create mbox named ABC, Abc, abc.
3. See created file name under Text.sbd, and check ABC.msf, Abc-X.msf, abc-Y.msf file content.
4. Rename a mbox to Abc to Abc-X -> Abc-X.msf is already used, so Abc-X-1.msf is perhaps used for new "Abc-X" folder.

Please never blindly assume case insensitivity on mbox name in IMAP merely by that file system on MS Win is case insensitive.
- In protocol named IMAP, case insensitive mbox name is "Inbox" only.
- Mbox name is passed from IMAP server as modified utf-7 string.
  Modified utf-7 string for SUPPLIER != Modified utf-7 string for Supplier
- IMAP server can freely choose file system of the IMAP server.
- Behavior of IMAP server for "rename SUPPLIER Supplier" depends on IMAP server.
  Gmail IMAP returns "already defined" because Gmail uses case insensitive file name system.
  Yahoo! IMAP returns different mbox because Yahoo! uses case sensitive file name system.

There is no way to know case sensitivity on mbox name in protocol named IMAP.
It can be called "current restriction in protocol named IMAP".
Who is responsible to avoid your confusion is you who chose the IMAP server and OS of your PC.
FYI.
Due to case insensitive file name on MS Windows, following can occur if IMAP server uses case sensitive mbox name/file name.
(0) Uncheck "Show only subscribed folders" in order to avoid affect by LSUB response.
(1) Create abc, Abc, ABC in this order => abc.msf, Abc-1.msf, ABC-2.msf is used for local file for these mbox.
(2) Create subfolder XXX under abc(abc/XXX), YYY under Abc(Abc/YYY), ZZZ under ABC(ABC/ZZZ)
    => abc.sbd\XXX.msf, Abc-1.sbd\YYY.msf, ABC-2.sbd\ZZZ.msf, are used for these sub folders.
(3) Syncronization with IMAP server is lost.
   (emulate it by terminate Tb, delete abc.msf, Abc-1.msf, ABC-2.msf, and restart Tb)
(4) Mbox name is usually returned in aplphabetic order
    => Mbox name are returned in order of ABC, Abc, abc
    => ABC.msf, Abc-1.msf, abc-2.msf are now used for mbox=ABC, mbox=Abc, mbox=abc
    => ABC.sbd\ZZZ.msf, Abc-1.sbd\YYY.msf, abc-2.sbd\XXX.msf are now used for sub folders. 

This kind of situation is pretty confusing, so almost all Thunderbird users will usually be sufficiently confused.
Such confusing situation was produced by your creation of mbox named ABC, Abc, abc, despite that MS WIndows uses case insensitive file system but your IMAP server uses case sensitive file system/mbox name.

Comment 9

10 months ago
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #6)
> Charles, does this reproduce with 52.0b3?
> http://www.mozilla.org/en-US/thunderbird/channel/

Sorry, been sick the last few days...

I just did a quick test with 50.0b3, and it does seem to be fixed in that now I get an immediate 'folder with that name already exists', so hopefully this one is nailed.

Thanks guys!

Updated

10 months ago
Flags: needinfo?(tanstaafl)

Updated

10 months ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago10 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.