Closed Bug 155430 Opened 23 years ago Closed 23 years ago

Cannot print mail with attachments

Categories

(MailNews Core :: Printing, defect)

All
Windows NT
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: cavin, Assigned: cavin)

References

Details

(Whiteboard: [ADT1 rtm])

Attachments

(1 file)

This is spun off bug 155189 whose patch is to prevent the program from crashing (and some of the attachments, like www.cnn.com, still can't be printed). This bug is filed to continue finding the real cause of the problem.
Adding ADT2 to the whiteboard.
Keywords: nsbeta1+
Whiteboard: [ADT2 rtm]
Attached patch patchSplinter Review
The problem is the print for a mail msg is started when the first notification of the document (mail msg) is done loading. This is wrong because if the mail msg has attachments they may not be loaded and then the msgPrintEngine gets additional notification for when the attachments have started to load and since it has already started toprint error dialogs appear AND the attachments don't get printed. The solution here is to cache a pointer to the DOM Window for the msg(s) being printed. Then as the "stop" notifications come in we can ignore any documents (which would be the attachments) where the dom window doesn't match the msg's dom window. Then when they match which is the last notifiaction we can call print. The notification that comes thru where the docLoader is NULL means the previous document has completed printing and the engine should print the next msg.
Let's get this reviewed. If it passes review, I'd like to see this checked into the trunk today so it can be verified on Monday for possible inclusion in the branch.
Comment on attachment 90088 [details] [diff] [review] patch r=cavin. I've tested the patch against a few msgs with various attachment typs and it works well. Thanks for the fix.
Attachment #90088 - Flags: review+
Attachment #90088 - Flags: superreview+
sr=sspitzer as well. from my aim converation with rod: Q: "when do we release the reference to mMsgDOMWin? is it when the print engine goes away? I just want to make sure we don't hold on to it." A: "Yes, it ends up being the same window and same reference for each msg that is printed. The destructor does get called, I checked it in the debugger"
fixed on trunk
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Esther, can you verify this on the trunk on Monday?
Yes, I take a trunk now and check it out.
Using trunk build 20020708 on winxp, I did a send page of cnn.com and aol.com, retrieved them and printed them. Both printed OK with no crash or hang or strange error messages. I checked other types of attachments by printing a msg with attached .jpg, .gif, .doc and .xls and it printed OK too. I also printed page 1 to 1 and even though it only printed page 1, the printer spit out a blank page for page 2. I need to see if this is a new bug. AND, the print dialog takes 5-6 seconds to come up when prining a mail message with attachments. Not sure if this is slower than previous build, I will check. Still need to check linux and mac for the crash.
I am not sure about page 2 being blank.... The slowness in the Print Dialog is that now it has to wait until everything has been loaded before it can display the Print Dialog, where before it waited only until the msg was loaded and NOT the attachments. In the future there will be a dialog that displays to show that something is happening.
Using trunk build 20020708 on linux, cnn.com and aol.com sent pages print OK, however after one time priniting aol.com, sent by Send Page from a winxp system, trying to print anything else afterwards gives an error "You can't print while in print preview". This does not happen when I print the cnn.com or netscape.com pages sent from winxp. This does not happen with 6.2.3 release build. This does not happen with the aol.com sent from a linux system using Send Page. This may be a different bug, I'll log a new one for this.
The 2nd page mentioned in comment #10 only happens when I print a mail message with cnn.com as an attachment so that's not a big deal. Other pages seem fine, a 5 page bug that was attached to a mail message prints only 1 page and does not add a blank page. Basically, WinXP is OK, no crash and mail messages with attachments do print. Mac 9.1 is basically OK. I am seeing a random problems printing the msg with aol.com attached that may not be due to the fix in this bug. I see the 3rd time printing the printed page is missing part of the content or the system locks up needing a force quit. But these may be part of bug 118795, I will investigate and log a new bug if necessary. One more test to do on Mac OS10.1
Mac OS 10.1 is working ok too. Prints mail message with aol.com, cnn.com attached. Prints message with one .jpg, .gif, .doc and .xls attached. Also note: Linux problem mentioned above does not happen with new profile and same messages. Verifying fixed on trunk can be checked into branch
Status: RESOLVED → VERIFIED
Blocks: 155189
adding adt1.0.1+. Please get drivers approval before checking into the branch.
Keywords: adt1.0.1adt1.0.1+
Whiteboard: [ADT2 rtm] → [ADT1 rtm]
Comment on attachment 90088 [details] [diff] [review] patch a=chofmann for 1.0.1 add the fixed1.0.1 keyword after checking into the branch
Attachment #90088 - Flags: approval+
fixed on branch
FYI.. found out cause of linux problem in comment 12, logged bug 156385.
Using branch build 20020709 on winxp, mac 9.1, linux and mac 10.1 and 3 mail messages. 1 with aol.com attached, 1 with cnn.com attached and one with .jpg, .gif, .doc, .xls attahced they all print fine, no crashes no printing error messages, no partial printing. I will retest this on the branch builds that includes the fix for 155189 before I verify it.
Using branch build 20020715 on winxp, mac 9.1 and linux which now includes the fix for 155189, printing the same messages as mentioned above in comment 7-9 this is still OK. All messages printed and there were no crashes, error messages or hangs. 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

Creator:
Created:
Updated:
Size: