Last Comment Bug 436606 - "ASSERTION: RemoveCurrentDraftMessage can't get draft id" involving message compose window
: "ASSERTION: RemoveCurrentDraftMessage can't get draft id" involving message c...
Status: RESOLVED FIXED
[has backtrace]
: assertion
Product: MailNews Core
Classification: Components
Component: Composition (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Thunderbird 19.0
Assigned To: Kent James (:rkent)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-30 15:42 PDT by Gary Kwong [:gkw] [:nth10sd]
Modified: 2012-10-10 12:55 PDT (History)
4 users (show)
rkent: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
both normal and full backtraces (46.05 KB, text/plain)
2008-05-30 15:42 PDT, Gary Kwong [:gkw] [:nth10sd]
no flags Details
Remove the assertion (1.10 KB, patch)
2012-10-09 16:59 PDT, Kent James (:rkent)
irving: review+
Details | Diff | Review

Description Gary Kwong [:gkw] [:nth10sd] 2008-05-30 15:42:10 PDT
Created attachment 323156 [details]
both normal and full backtraces

###!!! ASSERTION: RemoveCurrentDraftMessage can't get draft id: '(NS_SUCCEEDED(rv) && (!curDraftIdURL.IsEmpty()))', file /Users/skywalker/Desktop/Mozilla/cvs/mozilla/mailnews/compose/src/nsMsgCompose.cpp, line 393

The assertion fires when I open a message compose window (or reply to a message), not typing anything, and shifting focus to do something else. After awhile, the assertion will be caught in Terminal.
Comment 1 Wayne Mery (:wsmwk, NI for questions) 2009-05-07 07:49:16 PDT
Gary, could this be related to multiple drafts being saved?
Comment 2 Gary Kwong [:gkw] [:nth10sd] 2009-05-08 01:07:14 PDT
Possibly - though I can't say for sure. Maybe bienvenu knows what this assertion might mean?
Comment 4 :Irving Reid (No longer working on Firefox) 2012-01-24 12:27:23 PST
I'm also seeing this pretty reliably in Beta (v10) after leaving a compose window up for a few minutes.
Comment 5 Kent James (:rkent) 2012-10-09 16:54:32 PDT
The code where this happens is:

336   rv = m_compFields->GetDraftId(getter_Copies(curDraftIdURL));
337   NS_ASSERTION((NS_SUCCEEDED(rv) && (!curDraftIdURL.IsEmpty())), "RemoveCurrentDraftMessage can't get draft id");
338 
339   // Skip if no draft id (probably a new draft msg).
340   if (NS_SUCCEEDED(rv) && mMsgSend && !curDraftIdURL.IsEmpty())
341   

That is, the comment claims that new drafts will have curDraftIdURL.IsEmpty() and it behaves correctly. This is no place for an assertion.

I can get this simply by composing a new message, and trying to save it.

I say we just delete the assertion. It was added with the code for the entire method in Bug 319818.
Comment 6 Kent James (:rkent) 2012-10-09 16:59:05 PDT
Created attachment 669807 [details] [diff] [review]
Remove the assertion
Comment 7 :Irving Reid (No longer working on Firefox) 2012-10-10 12:42:36 PDT
Comment on attachment 669807 [details] [diff] [review]
Remove the assertion

Review of attachment 669807 [details] [diff] [review]:
-----------------------------------------------------------------

There's lots of silent discarding of nsresults in this method, but I'm happy to leave that to another bug unless you want to take it on.
Comment 8 Kent James (:rkent) 2012-10-10 12:48:53 PDT
(In reply to Irving Reid (:irving) from comment #7)
> 
> There's lots of silent discarding of nsresults in this method, but I'm happy
> to leave that to another bug unless you want to take it on.

I'm starting to figure out that that is a hot issue for you. For this bug though, I simply encountered the Assertion myself in some code work I was doing, analyzed it enough to figure out it was a false positive, then decided I would go ahead and do that narrow fix. I'm reluctant to do much more at the moment.
Comment 9 Kent James (:rkent) 2012-10-10 12:55:02 PDT
Checked in https://hg.mozilla.org/comm-central/rev/82d555dbf346

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