Save as text only includes the email subject

VERIFIED FIXED

Status

Thunderbird
General
--
major
VERIFIED FIXED
10 years ago
6 years ago

People

(Reporter: philor, Assigned: smaug)

Tracking

({regression})

Trunk
regression
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

10 years ago
STR:
1. Send yourself a plaintext email, with the subject "Subject" and the body "Body"
2. Select it in the threadpane, press ctrl+S
3. Change the filename from Subject.eml to Subject.txt
4. Save, then open in a text editor

Expected: file contains "Body"
Actual: file contains nothing but "Subject"

Regressed between 2008-02-19-03 and 2008-02-20-03 Windows builds, my first suspicion is bug 331530 but I haven't had a chance to test other platforms or try backing it out yet.
(Reporter)

Comment 1

10 years ago
Grr, where by bug 331530 I *mean* bug 417384.
Regression from bug 417384
Assignee: nobody → Olli.Pettay
Created attachment 304632 [details] [diff] [review]
proposed patch

Ok, I was wrong. Sorry. OpenHead does get called. Thunderbird serializes 
messages so that CNavDTD::AddHeadContent opens head.
Adding only NS_WARN_IF_FALSE to deconstructor, because that is sort of valid
case if something has caused serialization to stop while in <head>.
Attachment #304632 - Flags: superreview?(peterv)
Attachment #304632 - Flags: review?(peterv)
Severity: normal → major
Duplicate of this bug: 418719
Blocks: 417384
Attachment #304632 - Flags: approval1.9?
Shouldn't you add a testcase for correct behavior, too, to complement the one added in the bug that caused this regression?
Flags: in-testsuite?
Comment on attachment 304632 [details] [diff] [review]
proposed patch

Needs test.
Attachment #304632 - Flags: superreview?(peterv)
Attachment #304632 - Flags: superreview+
Attachment #304632 - Flags: review?(peterv)
Attachment #304632 - Flags: review+
Yes, tests are needed, if I just found some strange way to test this.
The relevant interfaces (nsIParser, nsIContentSink, nsIHTMLToText) aren't
scriptable.
The test is basically (succeeds without bug 417384 or with the patch in this bug):
void
ConvertBufToPlainText(nsString &aConBuf)
{
  nsCOMPtr<nsIParser> parser = do_CreateInstance(kCParserCID);
  if (parser) {
    nsCOMPtr<nsIContentSink> sink;
    sink = do_CreateInstance(NS_PLAINTEXTSINK_CONTRACTID);
    if (sink) {
      nsCOMPtr<nsIHTMLToTextSink> textSink(do_QueryInterface(sink));
      if (textSink) {
        nsAutoString convertedText;
        textSink->Initialize(&convertedText, 0, 72);
        parser->SetContentSink(sink);
        parser->Parse(aConBuf, 0, NS_LITERAL_CSTRING("text/html"), PR_TRUE);
        aConBuf = convertedText;
      }
    }
  }
}
nsString test;
test.AppendLiteral("<html><base>base</base><head><span>span</span></head><body>body</body></html>");
ConvertBufToPlainText(test);
printf("Test %s \n", test.EqualsLiteral("basespanbody") ? "succeeded" : "failed");
Will add a binary test
Created attachment 304704 [details] [diff] [review]
binary test.
Created attachment 304706 [details] [diff] [review]
typo fixed
Attachment #304704 - Attachment is obsolete: true
Comment on attachment 304632 [details] [diff] [review]
proposed patch

a=beltzner for 1.9
Attachment #304632 - Flags: approval1.9? → approval1.9+
Checked in the patch and test, and test run successfully on tboxes.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Duplicate of this bug: 418840
Verified FIXED using both:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b4pre) Gecko/2008022203 Thunderbird/3.0a1pre

and

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022206 Thunderbird/3.0a1pre ID:2008022206

Smaug: since you've landed tests, should you mark |in-testsuite +|?
Status: RESOLVED → VERIFIED
OS: Windows XP → All
Hardware: PC → All

Updated

10 years ago
Duplicate of this bug: 418947
Flags: in-testsuite? → in-testsuite+
Depends on: 744464
You need to log in before you can comment on or make changes to this bug.