Last Comment Bug 228949 - marking as junk with "delete mail marked as junk" set will undelete deleted mail
: marking as junk with "delete mail marked as junk" set will undelete deleted mail
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: Thunderbird 12.0
Assigned To: Kent James (:rkent)
:
Mentors:
: 208950 243586 (view as bug list)
Depends on:
Blocks: 578412
  Show dependency treegraph
 
Reported: 2003-12-19 05:18 PST by Chris P. Ross
Modified: 2012-01-25 13:24 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Only ask to delete undeleted messages (2.34 KB, patch)
2011-12-15 07:58 PST, Kent James (:rkent)
mozilla: review+
Details | Diff | Splinter Review
Unbitrotted patch (2.34 KB, patch)
2012-01-25 13:23 PST, Kent James (:rkent)
no flags Details | Diff | Splinter Review

Description Chris P. Ross 2003-12-19 05:18:39 PST
I have my options (on my IMAP mail folders/accounts) set such that deleted
messages are "marked as deleted", and when I manually mark a message as junk, it
should delete that message.
However, if a message is already marked for deletion, marking it as junk will
UNdelete it.  It appears that the "delete" is applied, and acts as a toggle.

This bug has been present for a long time, in both Mozilla Mail and Thunderbird.

Recreate:
1) Set the two prefs mentioned above as mentioned
2) Delete a non-pre-junked message
3) Mark said message as junk.

Results:
Message gets undeleted

Expected results:
Message gets marked as junk, but stays deleted.
Comment 1 Mike Cowperthwaite 2003-12-29 10:13:08 PST
Dupe of bug 208950?
Comment 2 Chris P. Ross 2003-12-29 10:38:40 PST
I don't think so.  It's hard to tell what problem bug #208950 is describing, but
I think it's talking about:
 - User selects Tools->Delete Mail Marked As Junk; and it will undelete any junk
mail that's already marked as deleted.

  Interestingly, I *don't* have that problem.  I don't think so at least.  I
have occasionally gone through and marked mail messages as junk, which cases
them to be deleted, and when I select "Delete Mail Marked As Junk..." it deletes
the other junk mail, and leaves the mail I manually marked as junk as deleted.

  My problem is when junking something, not when deleteing something.  Unlikely
a dup of bug #208950.
Comment 3 John Kubiatowicz 2004-04-29 17:16:40 PDT
This bug does, indeed, seem to have been present for a long time.  From what I
can tell, any action that causes a message to be marked as "junk" will toggle
the delete status of that message.

This is annoying, since I have several different browsers up on different
machines (one at home, one at work, one on my laptop).  Sometimes more than one
of them will declare something junk -- as a result, I seem to have a bunch of
messages marked as junk but undeleted... 
Comment 4 Mike Cowperthwaite 2004-09-03 15:04:53 PDT
(In reply to comment #2)
>   My problem is when junking something, not when deleteing something.  

Well, that would be true if you did not have the Junk Controls "delete when 
marked as junk" setting turned on.  As it is, you actually *are* deleting 
something when you junk it.  

If you type the <del> key on a deleted message, it undeletes.

See also Thunderbird bug 243586.
Comment 5 Mike Cowperthwaite 2005-07-18 09:23:42 PDT
*** Bug 208950 has been marked as a duplicate of this bug. ***
Comment 6 Mike Cowperthwaite 2005-07-18 09:24:03 PDT
*** Bug 243586 has been marked as a duplicate of this bug. ***
Comment 7 Chris P. Ross 2005-07-18 09:32:09 PDT
Can this please be picked up?  I don't immagine it would be that hard to have
the "delete" action taken as a result of marking a message as junk, when the
"delete mail marked as junk" pref is set, to actually check the message state to
make sure it's not deleted before performing the "delete" action (which really
just toggles the deleted state).
As otherwise noted, changing the way that action (the "delete" action) works
would be undesireable, so I think a check should just be put in for this one
code path.  I can't immagine anyone wants marking mail as junk to toggle the
messages deleted state.
Am I correct that it's basically this easy to fix?
Comment 8 neil@parkwaycc.co.uk 2005-07-18 15:47:49 PDT
(In reply to comment #7)
>Can this please be picked up?  I don't immagine it would be that hard to have
>the "delete" action taken as a result of marking a message as junk, when the
>"delete mail marked as junk" pref is set, to actually check the message state
>to make sure it's not deleted before performing the "delete" action (which
>really just toggles the deleted state).
Unfortunately the junk mail code doesn't know what the delete action is, or even
if there is a delete action. Of course, if people decided that it was safe to
apply a deleteNoTrash command to junk mail instead, as that never undeletes...
Comment 9 Nikolay Shopik 2008-07-11 00:55:04 PDT
version 3.0a2pre (2008071003) - WFM
Comment 10 Mike Cowperthwaite 2008-07-11 09:16:02 PDT
Nikolay, this is the second bug I've encountered that you've WFM'd apparently without testing, or not testing correctly.  This symptom still manifests.
Comment 11 Nikolay Shopik 2008-07-11 09:32:20 PDT
Retested reproduced, seems I misunderstand steeps to reproduce for first time.
Comment 12 Nikolay Shopik 2009-10-20 03:53:30 PDT
Kent, this is very close related to recently fixed bug 515927, maybe you interested to look into this.
Comment 13 Kent James (:rkent) 2009-10-22 09:52:44 PDT
I'm going to assign this to myself just so that it shows up on my radar screen, but if the fix is difficult I will probably punt.
Comment 14 Wayne Mery (:wsmwk, NI for questions) 2010-07-18 21:48:12 PDT
oddly similar to bug 578412
Comment 15 Kent James (:rkent) 2011-12-15 07:58:20 PST
Created attachment 581970 [details] [diff] [review]
Only ask to delete undeleted messages

Thought I'd toss off a try at this. Seems to me though that the decision to interpret "DeleteMessages" as "toggle delete" in the case of nsMsgImapDeleteModels::IMAPDelete was not the right one originally.
Comment 16 David :Bienvenu 2011-12-15 08:02:00 PST
(In reply to Kent James (:rkent) from comment #15)
> Created attachment 581970 [details] [diff] [review]
> Only ask to delete undeleted messages
> 
> Thought I'd toss off a try at this. Seems to me though that the decision to
> interpret "DeleteMessages" as "toggle delete" in the case of
> nsMsgImapDeleteModels::IMAPDelete was not the right one originally.

From the UI, for toggling the delete state, it's a reasonable choice, I think (if anything about the IMAP delete model can be called reasonable), but yeah, not for the backend code.
Comment 17 David :Bienvenu 2012-01-05 15:19:10 PST
Comment on attachment 581970 [details] [diff] [review]
Only ask to delete undeleted messages

thx, looks ok (though it's bit-rotted so you'll need to de-bit-rot before landing).
Comment 18 Ludovic Hirlimann [:Usul] 2012-01-24 23:49:55 PST
(In reply to David :Bienvenu from comment #17)
> Comment on attachment 581970 [details] [diff] [review]
> Only ask to delete undeleted messages
> 
> thx, looks ok (though it's bit-rotted so you'll need to de-bit-rot before
> landing).

ping :-)
Comment 19 Kent James (:rkent) 2012-01-24 23:53:21 PST
Yeah sorry, I keep getting distracted by other things. I'll try very hard to get to this tomorrow.
Comment 20 Kent James (:rkent) 2012-01-25 13:23:48 PST
Created attachment 591591 [details] [diff] [review]
Unbitrotted patch

Checked in http://hg.mozilla.org/comm-central/rev/0cb453fc659c

Note You need to log in before you can comment on or make changes to this bug.