Closed Bug 346630 Opened 15 years ago Closed 13 years ago

Undelete (Edit->Undo Delete Message) restores wrong message, ignoring/missing an imap move

Categories

(Thunderbird :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: athomps, Assigned: Bienvenu)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5

If you delete a message, and then undo the delete, the wrong message is restored.  Usually, it seems as if a messages several deletes back is restored.

For example, you delete message A, then B, then C, then do ctrl-Z or Edit->Undo Delete Message and it restores A or B, not C as it should.

This doesn't happen every time, but it does happen often enough for me to think it's a bug.

Reproducible: Sometimes

Steps to Reproduce:
1. Delete several messages (one at a time, not in a group)
2. Do Edit->Undo delete message (SHOULD restore most recently deleted message)


Actual Results:  
The message restored was several deletions back, not the most recently deleted message as it should be.

Expected Results:  
The most recently deleted message is the one that should be restored.

I was tempted to class this as "minor", except that for normal users, if the wrong message is restored on Undo, they might not know how to go into the trash and find and restore the RIGHT one.  Instead, they might sit there cursing TB because their message has vanished into the ether :-/  Also, any bug regarding deletion of messages probably shouldn't be called "minor" (IMO :)
This just happened to me *again*, and I was *unable to retrieve the deleted message*!

Note that when I reported this previously, I /assumed/ that the deleted message was available for retrieval in the Trash... Now that I found it wasn't the case, the message disappeared, I think this is a higher priority.

What just happened:

1. I deleted the wrong message in the message pane by hitting the delete key

2. I did Ctrl-Z to undo and get the message back

3. Instead of the deleted message reappearing, the message BEFORE that deletion (i.e., two deletions back) came back

4. When I went into the trash to find the original deleted message it was *not available*!

This was very disturbing, to say the least.
I found the missing message, which I thought was gone (see my last update) in a *totally different* folder.  So at least it wasn't vaporized, but it was still neither in the Trash nor the Inbox, the two places 99% of people would look.

I think the message was restored to a folder I had previously moved a different message to.  There's something seriously messed up with the undelete/delete/move code here.

Here's an example of what I think happened:

1. Cleaning out my inbox, I moved message #111 to folder ABC

2. I then deleted and moved several other messages, let's call them #222, #333, and #444

3. I accidentally deleted the wrong message (let's call it #555)

4. I hit Ctrl-Z to undo the deletion

5. The WRONG MESSAGE - #444 - was restored.

6. Not knowing what to do, I hit Ctrl-Z again; #333 (or even #222, I'm not sure) was restored instead.

7. At this point #555 has gone missing (MIA)

8. It is not back in the inbox where it belongs... and it's not in the Trash either

9. Instead, for some strange reason, #555 has been restored to folder ABC, which it was never in in the first place - this is the folder message #111 was moved to

I'd say that this undelete screwiness happens at least once every two or three times I try to undo a deletion; it's very common, and - I hope - very reproducible.
these are local messages or imap? I tried this and didn't see the problem. The undo objects are distinct and separate, so I don't see how an undo object would have the  destination folder of an other object, or the playback code would combine two objects...
It's IMAP.  I have server access if you need more information about the IMAP daemon.

Apparently saying imapd -v doesn't give you version info, but it did say this: IMAP4rev1 2001.315rh (if that's any help to you).

It also said "PREAUTH [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND]" - when I ran imapd from the command line on my mail server.

(This is with an ISP, not a home-grown box, so I'm going to assume it's a good and standard IMAP installation.)
If you can reproduce this at semi-will, an imap protocol log might be interesting:

substitute IMAP for protocol in these instructions:

http://www.mozilla.org/quality/mailnews/mail-troubleshoot.html#imap
OK, I've enabled the logging.  I tried to reproduce it, and of course the program is now making a liar out of me :)

I'll keep using TB with logging on, and hoping it happens again so I can catch it.
Aaargh, it just happened again but I'd forgotten to start it with the log running - doh!

This time, it wasn't a delete per se, it was a move.  What happened was:

1. I moved a message to a folder

2. I realized I wanted to reply to it, so I hit Ctrl-Z

3. Instead of the most recently-moved message being restored, a DIFFERENT message, which was deleted one or two messages back, was restored

4. I couldn't find the originally-moved message at all, even in the folder I moved it to.

I'm going to modify my Thunderbird shortcut so it points to the starttb.bat file I created, so I don't accidentally forget to start the log again.

(From this, I'm going to have to assume that the code which handles Delete is just a special kind of Move - Move to Trash; makes sense to me.)
OK, I got it - I was able to reproduce the error with the log running.  To whom should I send the log.  It's 49Kb (you're in luck, it happened shortly after I started the program with logging on :).

The specifics of what happened with this log:

1. I read and deleted a few e-mails.  One of them had a subject of "Re: FHO lead" (actually, I'd read that one before, so I think I just deleted that one).

2. Then I moved a message with a subject of "Dealing with people in denial" to a folder called "misc" (which is actually subfolder; Rick -> misc).

3. Then I hit ctrl-z to restore that message.

4. Instead of "Dealing with people in denial" being restored to my inbox, "Re: FHO lead" was restored.

5. I checked, and "Dealing with people in denial" WAS still in the Rick->misc folder.  So that didn't go MIA as I thought it might.

Let me know who the IMAP log should go to; thanks.
Please send the log to bienvenu @ nventure.com
(In reply to comment #9)
> Please send the log to bienvenu @ nventure.com
Just sent.
from the log, we seem to be skipping an undo action, and just undoing the delete, and ignoring the move. I'll look at the code and see if I can figure out why that would be. Is it possible the move hadn't fully completed before you did the undo?
I reproduced the failure to playback imap moves - it seems to be just skipping the moves. I'll look into it.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(In reply to comment #11)
> Is it possible the move hadn't fully completed before you did the undo?

Heh, anything's possible ;)  Realistically, I would estimate that it was about 2-3 seconds, possible as much as 4-5, between when I moved it and when I realized I actually wanted it back in the Inbox to reply to it, and thus hit Ctrl-Z.  My best guess would be 2.5 seconds from the move to the Ctrl-Z.
now it's working fine for me. So it seems like either some moves are missed, or somehow you get in a mode where imap moves in general are missed.

What version of TB are you using, btw? 1.5.0.x?
Assignee: mscott → bienvenu
Status: ASSIGNED → NEW
(In reply to comment #14)
> What version of TB are you using, btw? 1.5.0.x?
From Help->About: version 1.5.0.5 (20060719)
(In reply to comment #14)
> it seems like either some moves are missed, or somehow you get in a mode 
> where imap moves in general are missed.

It does seem that once things start getting messed up (which I define as the wrong messages being restored), it's beyond more than one message, meaning that delete-undelete continues to undelete the wrong message even after the first occurrance.

This is a complicated way of saying that it *sort of* does seem that I'm "in a mode" where things aren't right, even past the first problem.

If it happens again, maybe I'll see how long I can make the "bad streak" of problematic behavior last, i.e., how long it goes before returning to "normal".  

In the past, pretty much as soon as it started happening I'd quit TB and restart in order to get things back to "normal".
still see this in v2?
Summary: Undelete (Edit->Undo Delete Message) restores wrong message → Undelete (Edit->Undo Delete Message) restores wrong message, ignoring/missing an imap move
Anthony is still hanging on to v1.5 because of TB Header Tools extension. 

This is WFM version 2 and trunk, where I use undo quite often with no trouble.  
still WFM, TB 3 beta 2. did not find any fixed bug to dupe to  
 => WFM 

If you see this in an early release or TB3 when it is released, please reopen the bug
http://www.mozillamessaging.com/en-US/thunderbird/early_releases/

(and I just closed Bug 430132 mark 'thread as read" via R some times marks wrong message, which in some strange universe may be related)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.