Closed Bug 188051 Opened 23 years ago Closed 23 years ago

IMAP mark as read sends DeleteOrMoveMsgCompleted event

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows 95
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.3final

People

(Reporter: neil, Assigned: sspitzer)

References

()

Details

(Whiteboard: [adt3])

Attachments

(2 files, 2 obsolete files)

When using an IMAP folder, and I click on the Unread toggle in the thread pane, then immediately open the context menu for a message, then that message is loaded into the message pane. This doesn't happen with a local (POP) or news folder.
wfm - this is not likely to be an imap problem - it's the front end that tries to load the message.
BTW, I forgot to mention, the problem doesn't occur working offline either.
works for me in 1/6 trunk on xp. What build are you using Neil? and in your steps: 1.I click on the Unread toggle in the thread pane, 2.then immediately open the context menu for a message, 3.then that message is loaded into the message pane. Before step 1, is there a mesg already selected or no mesg selected at all in thread pane? after you do step 1, is that mesg selected? I assume in step 2, you are clicking another mesg and not the one you chose in step 1. What type of imap mail server? thanks.
IMAP server is from www.gordano.com * OK NTMail IMAP4 server v6.04.0010 ready Also, your analysis of my steps is correct - the message which I am right-clicking is not previously selected. Also, I have just discovered by tracing though with Venkman, that the problem is caused by a HandleDeleteOrMoveMsgCompleted item event. This event thinks that I just deleted a message in another window and checks the selection, sees that there is one item, and loads it. So why is this event being sent when I mark as read? It is sent for every mark as read, but this is normally not noticable.
Summary: IMAP mark as read sometimes selects message → IMAP mark as read sends DeleteOrMoveMsgCompleted event
Whiteboard: interop?
Neil, is this a release build or your own build? If the latter, have you tried doing a clobber? Have you been able to reproduce this with a released build?
This was originally in a Win nightly, and I double checked with a Linux build.
FYI: The event is generated by line 4485 in nsImapMailFolder.cpp
The URL being processed is imap://bad@mail:143/addmsgflags>UID>.INBOX>759>1
Surely the NotifyFolderEvent belongs inside this if?
Attached patch Proposed patch (obsolete) — Splinter Review
This fixes the problem for me.
Attachment #113677 - Flags: superreview?(sspitzer)
Attachment #113677 - Flags: review?(bienvenu)
No, I think the correct fix is to break out second clause of the if (the ShowDeletedMessages() part) and then put the Notify event inside the first clause. Otherwise, you're going to break stuff. So it should look something like this: if (flags & kImapMsgDeletedFlag) { if (!ShowDeletedMessages()) { nsCOMPtr<nsIMsgDatabase> db; rv = GetMsgDatabase(nsnull, getter_AddRefs(db)); if (NS_SUCCEEDED(rv) && db) { nsMsgKeyArray keyArray; char *keyString = nsnull; imapUrl->CreateListOfMessageIdsString(&keyString); if (keyString) { ParseUidString(keyString, keyArray); db->DeleteMessages(&keyArray, nsnull); db->SetSummaryValid(PR_TRUE); db->Commit(nsMsgDBCommitType::kLargeCommit); nsCRT::free(keyString); } } } NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom); }
Bah, DeleteOrMoveMessageCompleted is broken for IMAP mark as deleted anyway :-P
hoping to get to this for 1.3 final
Assignee: bienvenu → sspitzer
Severity: minor → normal
Keywords: nsbeta1
Target Milestone: --- → mozilla1.3final
Mail triage team: nsbeta1+/adt3
Keywords: nsbeta1nsbeta1+
Whiteboard: interop? → [adt3] interop?
accepting, since it must be driving imap delete model users (like neil) nuts. I'll investigate the fix bienvenu suggested.
Status: NEW → ASSIGNED
I'm using mark as deleted as my imap delete model, but I've not figure out how to reproduce this.
do you need to have a stand alone msg window open as well?
I am seeing something that neil reported back in comment #4. I see HandleDeleteOrMoveMsgCompleted() getting called when a message is marked as unread. I'll start there.
ok, this is what bienvenu was talking about in comment #11. I'm trying out his suggested fix now. what the current code does is when we add imap flags, we always send the deleted or copied folder event, but we should only be doing that when we add the "imap delete" flag.
Comment on attachment 113677 [details] [diff] [review] Proposed patch bienvenu suggested something else, I'll attach it.
Attachment #113677 - Flags: superreview?(sspitzer)
Attachment #113677 - Flags: superreview-
Attachment #113677 - Flags: review?(bienvenu)
Attachment #113677 - Flags: review-
Comment on attachment 113849 [details] [diff] [review] same fix, more comments, still need to test. r/sr=bienvenu
Attachment #113849 - Flags: superreview+
Comment on attachment 113849 [details] [diff] [review] same fix, more comments, still need to test. r/sr=sspitzer on bienvenu patch. I tested mark as delete and move to trash delete models, and we do the right thing. I bet there are other existing bugs that are dups of this. worth taking for 1.3 beta, so seeking approval.
Attachment #113849 - Flags: review+
Attachment #113849 - Flags: approval1.3b?
> Bah, DeleteOrMoveMessageCompleted is broken for IMAP mark as deleted anyway I think I know what neil is referring to. in this delete model, we don't select the next message, instead of the next un- deleted message. see bug #65823. if you mean something else, let me know.
Comment on attachment 113849 [details] [diff] [review] same fix, more comments, still need to test. I think we're wrapped on 1.3beta so this will have to wait 'till final.
Attachment #113849 - Flags: approval1.3b? → approval1.3b-
As well as those issues, I seem to remember that no event is generated when you are offline or after a compact.
Comment on attachment 113849 [details] [diff] [review] same fix, more comments, still need to test. seeking approval for 1.3 final.
Attachment #113849 - Flags: approval1.3b- → approval1.3?
Comment on attachment 113849 [details] [diff] [review] same fix, more comments, still need to test. asa says (over irc) a=asa for 1.3 final, but wait until the tree is ready for 1.3 final checkins.
Attachment #113849 - Flags: approval1.3? → approval1.3+
fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
> As well as those issues, I seem to remember that no event is generated when > you are offline or after a compact. neil, can you log a new bug on that issue?
Whiteboard: [adt3] interop? → [adt3]
Bliss!
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: