Closed Bug 180477 Opened 22 years ago Closed 22 years ago

clicking junk status icon can crash (or not work) from search dialog

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.3alpha

People

(Reporter: sspitzer, Assigned: sspitzer)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

junk status icon doesn't cycle in search dialog when you click on it.
...except for the last message in the search results

I also got a crash doing this, see 
http://climate.netscape.com/reports/incidenttemplate.cfm?bbid=14013653
Blocks: 11035
I bet it's because m_folder is null.

I bet we need to override OnMessageClassified (and more) for the search view.

     nsMsgDBView::OnMessageClassified  
[c:/builds/seamonkey/mozilla/mailnews/base/src/nsMsgDBView.cpp, line 2534] 
     nsBayesianFilter::observeMessage  
[c:/builds/seamonkey/mozilla/mailnews/extensions/bayesian-spam-
filter/src/nsBayesianFilter.cpp, line 721] 
     MessageObserver::analyzeTokens  
[c:/builds/seamonkey/mozilla/mailnews/extensions/bayesian-spam-
filter/src/nsBayesianFilter.cpp, line 654] 
     TokenStreamListener::OnStopRequest  
[c:/builds/seamonkey/mozilla/mailnews/extensions/bayesian-spam-
filter/src/nsBayesianFilter.cpp, line 434] 
     nsStreamConverter::OnStopRequest  
[c:/builds/seamonkey/mozilla/mailnews/mime/src/nsStreamConverter.cpp, line 
1100] 
     nsStreamListenerTee::OnStopRequest  
[c:/builds/seamonkey/mozilla/netwerk/base/src/nsStreamListenerTee.cpp, line 66] 
     nsOnStopRequestEvent0::HandleEvent  
[c:/builds/seamonkey/mozilla/netwerk/base/src/nsAsyncStreamListener.cpp, line 
321] 
     nsStreamListenerEvent0::HandlePLEvent  
[c:/builds/seamonkey/mozilla/netwerk/base/src/nsAsyncStreamListener.cpp, line 
122] 
     PL_HandleEvent  [c:/builds/seamonkey/mozilla/xpcom/threads/plevent.c, line 
645] 
     PL_ProcessPendingEvents  
[c:/builds/seamonkey/mozilla/xpcom/threads/plevent.c, line 578] 
     _md_EventReceiverProc  
[c:/builds/seamonkey/mozilla/xpcom/threads/plevent.c, line 1336] 
     nsAppShellService::Run  
[c:/builds/seamonkey/mozilla/xpfe/appshell/src/nsAppShellService.cpp, line 472] 
     main1  [c:/builds/seamonkey/mozilla/xpfe/bootstrap/nsAppRunner.cpp, line 
1556] 
     main  [c:/builds/seamonkey/mozilla/xpfe/bootstrap/nsAppRunner.cpp, line 
1904] 
     WinMain  [c:/builds/seamonkey/mozilla/xpfe/bootstrap/nsAppRunner.cpp, line 
1924] 
     WinMainCRTStartup()    
     KERNEL32.DLL + 0xd326 (0x77e8d326)    
this is a crasher.

raising severity to major
Severity: normal → major
Summary: junk status icon doesn't cycle in search dialog when you click on it → clicking junk status icon can crash (or not work) from search dialog
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
QA Contact: olgam → laurel
taking, fix in hand
Assignee: dmose → sspitzer
Status: ASSIGNED → NEW
Attached patch patch (obsolete) (deleted) — Splinter Review
a possible optimization would be to add a helper method like
GetMsgFolderFromUri() to nsMsgDBView, where the base class returns m_folder, and
nsMsgSearchDBView does this work.

I'll ask bienvenu and see what he thinks.

Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.3alpha
yes, I think you should do that optimization. I'd hate to slow us down like that
just for the search view.
working on a new patch, with the optimization...
Attached patch patch, plus some code cleanup (obsolete) (deleted) — Splinter Review
Attachment #107567 - Attachment is obsolete: true
+  rv = msgHdr->GetFolder(aFolder);
+  NS_ENSURE_SUCCESS(rv,rv);
+  return rv;
 how about just return msgHdr->GetFolder(aFolder) ? If the caller wants to warn,
that's fine.

I'm in the middle of redoing +nsresult nsBayesianFilter::tokenizeMessage(const
char* aMessageURI, nsIMsgWindow *aMsgWindow, TokenAnalyzer* analyzer)

so I wonder if you'll let me make your changes to that code in my tree, so we
can avoid conflicts?
I won't check in the conflicting change and I'll fix GetFolder() code.

as soon as I'm done testing, I'll attach a final patch.
taking with david, we found an existing problem in some of the view code.

working on it now...
I believe the problem is here in nsMsgDBView::ApplyCommandToIndices:

        rv = GetFolderForViewIndex(GetAt(indices[0]), getter_AddRefs(folder));

this should be 
       rv = GetFolderForViewIndex(indices, getter_AddRefs(folder));

i.e., we should pass in the view index, not the msgKey.
Attached patch patch, with code cleanup (deleted) — Splinter Review
david was right, that was the problem.

the reason it wasn't the problem for the base view is that method for the base
class always uses m_folder
Attachment #107600 - Attachment is obsolete: true
fixed.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
OK using 2003-01-13 commercial trunk: win98, mac OS 10.2, linux rh8.0
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: