IMAP: Undo delete of select all msgs not working (DeleteIsMoveToTrash() mode)

VERIFIED FIXED

Status

--
major
VERIFIED FIXED
17 years ago
10 years ago

People

(Reporter: laurel, Assigned: naving)

Tracking

({dataloss})

Trunk
dataloss

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [adt2 RTM])

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
Using apr16 trunk win98
Using apr12 branch win98, linux rh6.2

If you used Ctrl+A or Shift+Select to select all messages in an IMAP folder
(Move to Trash delete setting) then clicked delete, if you go to Undo Delete
nothing happens.  The trash message count appears to still have the deleted
messages, but when you go to trash to find them (and manually undelete them) the
messages don't appear and the count in trash folder decreases.  Opening the
original folder again does not display the messages... they have apparently been
really deleted.  Every once in awhile the messages will indeed still show in the
trash folder (this may be only when using Shift+Select), but most of the tries I
found no messages displaying in trash.  I found this to happen in either
threaded mode or flat sort, View All messages.

This happened for me in many tries, but only when I selected folders having
approx 35 messages or more, more than a thread pane screen -- it didn't happen
when I used small folders.

Steps:
1.  Open an IMAP folder on (account which is set to move messages to trash on
delete) with lots of messages. View is set to View All messages. Ctrl+A to
select all messages.
2.  Click Delete button.  Messages are removed from the thread pane.
3.  Still in the folder thread pane, Edit|Undo Delete.  Nothing happens -- the
thread pane is still blank.
4.  Trash folder shows message total with a count that indicates messages are
still in trash.  Select the trash folder, the deleted messages may or may not
appear in the trash.

Result:  Undo delete of all messages in IMAP folder doesn't work properly. In
many cases it will not display the messages in either trash folder or original
folder.  Note: I did not see the problem on POP.

Expected:  After Undo delete, messages should appear back in thread pane.  At
worst case they should always still be in the trash for user to move back to
folder (manually undo).
(Reporter)

Updated

17 years ago
Keywords: nsbeta1
QA Contact: gayatri → laurel
(Assignee)

Comment 1

17 years ago
taking. I am Undo owner, you can file Undo bugs on me directly. 
Assignee: mscott → naving
(Reporter)

Comment 2

17 years ago
In most cases, if the messages are not in the trash or the original folder, they
do not show up after restart, either.  

Comment 3

17 years ago
dup of bug 132121?
(Reporter)

Comment 4

17 years ago
Bug 132121 is about Shit+Delete as in Delete Immediately without sending to
trash.  So, no, I wouldn't think this is a duplicate of that.
(Reporter)

Comment 5

17 years ago
Obviously, that last comment was supposed to be SHIFT + Delete, shift with an f
in it.  No four letter word slinging was intended.
(Assignee)

Comment 6

17 years ago
I am able to reproduce this on 4.x also. Looks like this bug has been around
for a while. 
Status: NEW → ASSIGNED
Summary: Undo delete of select all msgs not working, msgs may not appear in trash or orig folder → IMAP: Undo delete of select all msgs not working, msgs may not appear in trash or orig folder
(Assignee)

Comment 7

17 years ago
Created attachment 79713 [details] [diff] [review]
proposed fix

The fix is to not do an expunge when we are liteSelecting a folder because
we could be doing an undo.
(Assignee)

Comment 8

17 years ago
david, can you review ? thx.
Keywords: dataloss
Summary: IMAP: Undo delete of select all msgs not working, msgs may not appear in trash or orig folder → IMAP: Undo delete of select all msgs not working (DeleteIsMoveToTrash() mode)

Comment 9

17 years ago
Comment on attachment 79713 [details] [diff] [review]
proposed fix

r=bienvenu - makes sense
Attachment #79713 - Flags: review+

Comment 10

17 years ago
Comment on attachment 79713 [details] [diff] [review]
proposed fix

sr=mscott
Attachment #79713 - Flags: superreview+
(Assignee)

Comment 11

17 years ago
fixed on trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Keywords: adt1.0.0
Resolution: --- → FIXED

Comment 12

17 years ago
Laurel, can you test this patch on the trunk build and update the bug with the
results?
(Reporter)

Comment 13

17 years ago
Using apr19 trunk, win98:
I've done many tries with today's trunk and have mixed results to report...
A straight, simple, Undo delete of a select all messages will usually work in
this build.  I did see it fail once at this level.
However, if you've previously done things such as delete a couple individual
messages and/or changed folders before the select All delete, you'll run into
some problems.  Some things I'm seeing:
1.  Upon the Undo of the All deletion I'm often seeing the messages in both the
Trash and the originating folder, i.e. they were not released from the trash.
2.  If you do any further delete/undo operations if you're in condition #1
above, things can get screwy and undo often won't work.
3.  In many cases I'm seeing the Undo appear not to work, but if you click the
thread pane in the folder, the messages refresh/appear.
4.  If I do a Del/Undo/Redo/Undo, I'm finding the messages are usually jumping
into a black hole somewhere and don't come back.

Bottom line: Simplistic Undo of Select All & Delete will usually work. If you
add anything before the simplistic part, you may get some screwy results.

I'll let you all decide whether this means it's okay for the branch. 
(Reporter)

Comment 14

17 years ago
Oh, yeah. The case I saw where the simplistic delete/undo failed, the messages
were still appearing in the trash, so they weren't totally missing.

Comment 15

17 years ago
Laurel - Are you verifying this as fixed, and that this patch does not cause any
other regressions? 

[adt2] - As this will be very severe for the people that hit this, however, this
does not seem like a very likely scenario, and users who delete all from
folders, can probably retrieve the data from their Trash Folder.
Whiteboard: [adt2]
(Reporter)

Comment 16

17 years ago
I went back to 6.2.2 and tried to see if the surrounding issues were there. Of
course, it was hard to tell because select all+delete+undo didn't work.  I ran
into similar cases in that the thread pane didn't refresh after undo until you
clicked in the thread pane... I suppose this was all there.  Ditto for previous
trunk/branch versions of current release.

So, I guess it's better than it was, but we still have some goofy paths where
undo screws up.  I guess I'll go for marking this verified on trunk, april 19
commercial trunk win98.
Status: RESOLVED → VERIFIED

Comment 17

17 years ago
The only thing I can shed light on is that if you delete a bunch of messages,
select another folder, and then select the first folder again, undo may not work
simply because selecting the folder can cause an expunge, which permanently
removes the deleted messages from the folder. That's always been true, even back
in 4.x

Updated

17 years ago
Keywords: nsbeta1 → nsbeta1+

Comment 18

17 years ago
In Jaime's reason for ADT2 he said the user can always go to the trash.  Is that
true?  It sounds like from the original description that a lot of the time the
messages aren't in the trash.  Or, is that only after doing undo?
(Reporter)

Comment 19

17 years ago
Without the fix, if the user does Undo delete, they may or may not have the
messages in the trash.  With the fix, the likelihood they're in the trash is good.
With/without the fix, if the user does a delete without Undo, the messages are
in the trash.  

Comment 20

17 years ago
I think that's after doing undo - undo removes the deleted message from the
trash, but then can't restore it to the original folder because it does that by
unsetting the /deleted flag on the message in the original folder. If an expunge
has happened, then that won't work because expunge *really* deletes deleted
messages. It seems to me that if we detect this case, we should be moving the
message from the trash to the source folder.
(Assignee)

Comment 21

17 years ago
yes, we should try to move the msgs from trash to source folder if an expunge
has happened. I'll log a separate bug for that. 

If you don't do undo the msgs should be in trash.

Comment 22

17 years ago
let's get this one for RTM, adt1.0.0-.
Keywords: adt1.0.0 → adt1.0.0-
Whiteboard: [adt2] → [adt2 RTM]
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.