Implement onProgress for the send later service, and fix counts for sending more than once in the same session.

RESOLVED FIXED in Thunderbird 3.0b2


11 years ago
10 years ago


(Reporter: standard8, Assigned: standard8)


Thunderbird 3.0b2
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)



(1 attachment)



11 years ago
Posted patch The fixSplinter Review
As part of the work I'm doing on the send later service, I realised that we are not utilising the onProgress function of the listener.

This patch:

- Implements a notification for onProgress. I think that this doesn't cover the error cases very well at the moment - they tend to use onStopSending, I'll look at them in a different bug.
- Resets the counts for the number of messages sent in SendUnsentMessages which is the start of the sending process. This means we get the right count on a second unsent message send later on in the same session.
- Reworks the existing tests a little bit to share the copyListener - we only need one function in here, so it doesn't make sense to copy/paste the rest of them.
- Implements a test which covers the sending unsent messages twice in the same session. It would test the onProgress, but due to the fact we send messages on different connections, I found it very hard to reliably get the fake server to reconnect. Therefore I've commented that out for now and hope that we'll fix bug 136871 sometime soon.
Attachment #360718 - Flags: superreview?(bienvenu)
Attachment #360718 - Flags: review?(bienvenu)

Comment 1

11 years ago
I'm seeing various test failures with the patch applied - they mostly look like this:

Message Delivery Failed!
###!!! ASSERTION: attempted to open a new window with no WindowCreator: 'mWindow
Creator', file C:/mozilla-build/msys/tbirdcheck/mozilla/embedding/components/win
dowwatcher/src/nsWindowWatcher.cpp, line 668
embedcomponents!nsWindowWatcher::OpenWindow+0x0000000000000385 (c:\mozilla-build
cpp, line 421)
embedcomponents!nsPromptService::DoDialog+0x000000000000014D (c:\mozilla-build\m
p, line 786)
embedcomponents!nsPromptService::Alert+0x0000000000000256 (c:\mozilla-build\msys
line 145)
embedcomponents!nsPrompt::Alert+0x0000000000000034 (c:\mozilla-build\msys\tbirdc
heck\mozilla\embedding\components\windowwatcher\src\nsprompt.cpp, line 199)
msgcompo!nsMsgDisplayMessageByString+0x00000000000000E3 (c:\mozilla-build\msys\t
birdcheck\mailnews\compose\src\nsmsgprompts.cpp, line 98)
msgcompo!nsMsgSendReport::DisplayReport+0x000000000000064F (c:\mozilla-build\msy
s\tbirdcheck\mailnews\compose\src\nsmsgsendreport.cpp, line 379)
msgcompo!nsMsgComposeAndSend::Fail+0x0000000000000116 (c:\mozilla-build\msys\tbi
rdcheck\mailnews\compose\src\nsmsgsend.cpp, line 3880)
msgcompo!nsMsgComposeAndSend::DoDeliveryExitProcessing+0x0000000000000125 (c:\mo
zilla-build\msys\tbirdcheck\mailnews\compose\src\nsmsgsend.cpp, line 3956)
msgcompo!nsMsgComposeAndSend::DeliverAsMailExit+0x0000000000000015 (c:\mozilla-b
uild\msys\tbirdcheck\mailnews\compose\src\nsmsgsend.cpp, line 4017)
msgcompo!nsMsgComposeAndSend::SendDeliveryCallback+0x000000000000011A (c:\mozill
a-build\msys\tbirdcheck\mailnews\compose\src\nsmsgsend.cpp, line 3572)
msgcompo!MsgDeliveryListener::OnStopRunningUrl+0x0000000000000095 (c:\mozilla-bu
ild\msys\tbirdcheck\mailnews\compose\src\nsmsgsend.cpp, line 278)
msgbsutl!nsMsgMailNewsUrl::SetUrlState+0x00000000000001BA (c:\mozilla-build\msys
\tbirdcheck\mailnews\base\util\nsmsgmailnewsurl.cpp, line 135)
msgbsutl!nsMsgProtocol::OnStopRequest+0x00000000000000F9 (c:\mozilla-build\msys\
tbirdcheck\mailnews\base\util\nsmsgprotocol.cpp, line 394)
msgcompo!nsSmtpProtocol::OnStopRequest+0x0000000000000068 (c:\mozilla-build\msys
\tbirdcheck\mailnews\compose\src\nssmtpprotocol.cpp, line 430)
necko!nsInputStreamPump::OnStateStop+0x00000000000000DE (c:\mozilla-build\msys\t
birdcheck\mozilla\netwerk\base\src\nsinputstreampump.cpp, line 577)
necko!nsInputStreamPump::OnInputStreamReady+0x0000000000000090 (c:\mozilla-build
\msys\tbirdcheck\mozilla\netwerk\base\src\nsinputstreampump.cpp, line 401)
xpcom_core!nsInputStreamReadyEvent::Run+0x000000000000004A (c:\mozilla-build\msy
s\tbirdcheck\mozilla\xpcom\io\nsstreamutils.cpp, line 112)
xpcom_core!nsThread::ProcessNextEvent+0x00000000000001FA (c:\mozilla-build\msys\

I'll try with a clean tree...

Comment 2

11 years ago
I see the "failures" w/o the patch as well, but they don't show up as real failures. I'd like to try to figure out why the backend is claiming failure. I worry that it has to do with the db changes but it's difficult to debug the backend code when running tests...

Comment 3

11 years ago
Comment on attachment 360718 [details] [diff] [review]
The fix

everything's fine on the mac, and the windows issue is independent of this patch, so r/sr=me
Attachment #360718 - Flags: superreview?(bienvenu)
Attachment #360718 - Flags: superreview+
Attachment #360718 - Flags: review?(bienvenu)
Attachment #360718 - Flags: review+

Comment 4

11 years ago
I'm wondering if you see the windows issue on your side...

Comment 5

11 years ago
(In reply to comment #4)
> I'm wondering if you see the windows issue on your side...

I just tried it on my windows VM and couldn't reproduce that assertion with the patch. I do believe you're most likely to get that assertion (its trying to stick up a dialog) if it can't contact the server.

I'll check this in tomorrow and see how the tinderboxes like it.

Comment 6

11 years ago
I checked this in a few days ago: it seems to have stuck, therefore marking fixed.
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Depends on: 486996
You need to log in before you can comment on or make changes to this bug.