Last Comment Bug 358100 - Unable to save IMAP or NNTP message as a file
: Unable to save IMAP or NNTP message as a file
Status: RESOLVED FIXED
: fixed-seamonkey1.1, fixed1.8.1, regression, verified1.8.1.3
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Karsten Düsterloh
:
Mentors:
: 339115 (view as bug list)
Depends on:
Blocks: 328027
  Show dependency treegraph
 
Reported: 2006-10-25 16:40 PDT by Jeff Wieland
Modified: 2008-07-31 01:21 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Close any streams before deleting the target file (965 bytes, patch)
2006-10-29 13:04 PST, Karsten Düsterloh
mozilla: review+
mozilla: superreview+
Details | Diff | Splinter Review

Description Jeff Wieland 2006-10-25 16:40:34 PDT
User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1) Gecko/20061022 SeaMonkey/1.1b
Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1) Gecko/20061022 SeaMonkey/1.1b

Saving an email message as a file fails.

Reproducible: Always

Steps to Reproduce:
1. Select an email message.
2. Right click on it and save it as a file.
3. Check to see if the file is there -- it won't be in my case.

Actual Results:  
No file is produced.

Expected Results:  
A file should be created.
Comment 1 Jeff Wieland 2006-10-25 16:44:37 PDT
I should add that this was present in the 1.1 alphas for at least a couple of months.
Comment 2 Frank Wein [:mcsmurf] 2006-10-25 16:46:00 PDT
Do you see any error in the Error Console under Tools->Web Development while/after saving to a file? Do you know if this works in SeaMonkey 1.0.x?
Comment 3 Jeff Wieland 2006-10-25 16:49:03 PDT
(In reply to comment #2)
> Do you see any error in the Error Console under Tools->Web Development
> while/after saving to a file? Do you know if this works in SeaMonkey 1.0.x?
> 

I see no errors there, and yes, it does work fine in Seamonkey 1.0.5.
Comment 4 Robert Kaiser 2006-10-26 03:58:07 PDT
Confirmed in Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.8.1) Gecko/20061024 SeaMonkey/1.1b (self-compiled)
Comment 5 Jeff Wieland 2006-10-26 04:07:02 PDT
I had been building using GTK1.  I rebuilt last night using GTK2 (an interesting process under Solaris 8), and the problem persists.
Comment 6 Robert Kaiser 2006-10-26 11:03:02 PDT
OK, I've just done some more testing. Actually, saving local messages (POP or localo folders) works, but saving messages from IMAP or NNTP (news) doesn't work. Adjusting summary to reflect that.

Karsten, Neil, could someone familiar with MailNews and/or file saving look into that?
Comment 7 Robert Kaiser 2006-10-26 11:07:09 PDT
Just to clarify:
File picker comes up as usual, no message in error (JS) console, but no file showing up on disk. And it's independent of using context or "File" menu entries for "Save as", it always the same. As I already stated, POP/local messages work fine.
Comment 8 Karsten Düsterloh 2006-10-26 14:31:23 PDT
I don't see this with a recent Tpol Windows branch nightly, but I can confirm it under MacOS X...
Comment 9 neil@parkwaycc.co.uk 2006-10-26 15:30:54 PDT
I can confirm that both trunk and branch Windows save IMAP messages,
while my trunk Linux build does not (I have no branch Linux build).
Comment 10 Andrew Schultz 2006-10-27 20:01:37 PDT
This regressed between linux seamonkey builds 2006-05-19-09-trunk and 2006-05-20-08-trunk, probably bug 328027
Comment 11 Karsten Düsterloh 2006-10-28 21:43:57 PDT
I did (because I didn't look here :|) my own regression window search on Mac-1.8-branch and get 2006-05-21-13 okay, while 2006-05-23-17 is broken (no other builds are available on ftp.m.o).
And I, too, found bug 328027 as the most likely suspect in that window, especially since some debugging I did earlier did indeed touch the very functions changed there...
Comment 12 Karsten Düsterloh 2006-10-28 21:59:48 PDT
Backing out bug 328027 does indeed fix this regression - as was already noted in bug 339115...
Comment 13 Karsten Düsterloh 2006-10-29 13:04:32 PST
Created attachment 244005 [details] [diff] [review]
Close any streams before deleting the target file

So, the problem is this:
In nsMessenger::SaveAs we create a nsSaveMsgListener, which (due to bug 328027) automatically opens the stream on the nsIFileSpec object, creating an empty file. But the actual save operation for IMAP and NNTP is done by a nsMsgSaveAsListener, which first deletes any such file - but the stream is still open and all data goes to nirvana...
This patch is against 1.8 branch, but applies to trunk as well.
Comment 14 David :Bienvenu 2006-10-29 17:32:08 PST
Comment on attachment 244005 [details] [diff] [review]
Close any streams before deleting the target file

nice work, Karsten, thx for fixing this. Can you add a comment to the code, just like your last comment in the bug?
Comment 15 Karsten Düsterloh 2006-11-04 09:07:45 PST
Landed on trunk, but we _really_ should get this into the 1.8 branch soon!
Comment 16 Chris Thomas (CTho) [formerly cst@andrew.cmu.edu cst@yecc.com] 2006-11-05 07:53:55 PST
You need to set the relnote keyword if you want a relnote.  I did not find this in any of my queries.
Comment 17 Mike Cowperthwaite 2006-11-06 10:21:06 PST
FYI: with TB 2b1-1026, Win2K, I have no problems saving messages (as .EML) from IMAP or NNTP.  Is there some additional step to reproduce not listed in comment 0?
Comment 18 David :Bienvenu 2006-11-06 14:14:13 PST
it only seems to be a problem on linux and mac. Anyway, I'll land this for 2.0 - it should be marked fixed, since it's fixed on the trunk.
Comment 19 David :Bienvenu 2006-11-06 14:25:03 PST
fixed on branch, removing relnote keyword, not sure why we'd need that anymore.
Comment 20 Magnus Melin 2006-11-07 09:17:36 PST
*** Bug 339115 has been marked as a duplicate of this bug. ***
Comment 21 Karsten Düsterloh 2006-11-28 06:03:11 PST
Comment on attachment 244005 [details] [diff] [review]
Close any streams before deleting the target file

Clearing approval flags, it's already on the branch...
Comment 22 Carsten Book [:Tomcat] - PTO-back Sept 4th 2007-04-04 14:11:35 PDT
verified fixed 1.8.1.3 with Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.0 ID:2007032620 using my imap account and my nntp account.

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