Closed Bug 170727 Opened 22 years ago Closed 4 years ago

A point [dot] "." at the beginning of a news post line will sometimes be doubled

Categories

(MailNews Core :: Networking: NNTP, defect)

defect
Not set
normal

Tracking

(thunderbird_esr78+ fixed, thunderbird83 affected)

RESOLVED FIXED
84 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird83 --- affected

People

(Reporter: frank.1977, Assigned: infofrommozilla)

References

Details

Attachments

(1 file, 3 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020907 MultiZilla/v1.1.22 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020907 MultiZilla/v1.1.22 In <amne7r$798u4$2@ID-76139.news.dfncis.de> wrote someone: | Content-Type: text/plain; charset=ISO-8859-1 | Content-Transfer-Encoding: 8Bit <quote> body {font-size:medium;} .a {font-size:10px;} .b {font-size:10pt;} .c {font-size:10ex;} </quote> some people answered to that message and got back the following: <quote> > body {font-size:medium;} > ..a {font-size:10px;} > ..b {font-size:10pt;} </quote> their preferences: Message-ID: <ams3p8$8ka6d$1@ID-57159.news.dfncis.de> Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2b) Gecko/20020923 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit => this poster said he will see it in the original text, in the edit-window and after loading it from the newsserver Message-ID: <amqa89$5ngbs$1@ID-76139.news.dfncis.de> User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2a) Gecko/20020911 Hamster/1.3.23.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8Bit I couldn't reproduce Message-ID: <ams3nj$8iak5$1@ID-124416.news.dfncis.de> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020907 MultiZilla/v1.1.22 Hamster/1.3.23.191 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit also couldn't Message-ID: <amsd8j$48f$02$1@news.t-online.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.2a) Gecko/20020910 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit We imagine, that it could be perhaps the "." at the beginning of the line. One "." represents the End of a posting in NNTP. So you habe to code the "." that it's representing the char "." Perhaps mozilla won't take away the second "." when fetching the message from the news-server? Reproducible: Sometimes Steps to Reproduce: wo can't reproduce it - it happens
This bug is still in the 1.3b release! I've found a way to reproduce it (but I don't have confirm rights): According to RFC977, lines in news postings starting with the period "." are transmitted with this dot doubled "..". The newsreader has to take care of that and decode it back to ".". If a posting is shown directly from the server, the display is correct. Lines starting with a period show only one period. (This happens if news are read *online* and the group is *not* selected for download, i.e. read postings are *not* stored locally. It occurs also if displaying the posting's source, because this still :( requires to be in online mode.) If a group is selected for download, displayed postings will be stored locally. The first time a posting is shown, it is displayed as if no storing takes place - one dot at line start (obviously, the posting shown comes directly from the server). *Every* display of this posting afterwards uses the *locally* *stored* posting - and this fails. Postings shown from local storage show *two* periods at line start. This bug does *not* with mail, only with news.
One additional remark: Since this "double point" is part of the nntp protocol and not part of the posting, this bug should be fixed at the point of *storing* the message locally. The display routines should not cope with that.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: A point "." at the begionning of a line will be doubled sometimes → A point [dot] "." at the beginning of a line will be doubled sometimes
Product: MailNews → Core
*** Bug 349524 has been marked as a duplicate of this bug. ***
sorry for the spam. making bugzilla reflect reality as I'm not working on these bugs. filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Simple fix: nsNNTPProtocol::DisplayArticle doesn't handle the double dot properly, while nsNNTPProtocol::ReadArticle does. I'll tackle this once I get bug 413077 in so I can hopefully write a testcase for this problem.
OS: Windows 2000 → All
QA Contact: stephend → networking.news
Hardware: PC → All
Product: Core → MailNews Core
Whiteboard: [good first bug]
Joshua, bug 413077 is fixed, will you tackle this?
Bug still there in Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0, according to <news:jvgabm$md7$1@speranza.aioe.org>. According to <news:jvkaec$42q$1@speranza.aioe.org>, it only happens with offline reading.
Summary: A point [dot] "." at the beginning of a line will be doubled sometimes → A point [dot] "." at the beginning of a news post line will sometimes be doubled
Is this issue still active
Keywords: good-first-bug
Whiteboard: [good first bug]

I don't see any reason why the double dot was saved here in the first place.
If TB saves the articles directly offline, he also removes the dot.

Assignee: nobody → infofrommozilla
Attachment #9179426 - Flags: review?(Pidgeot18)

I added a test.
For that I had to trick a little. Apparently the dot handling in the test server does not work correctly either. But the result is in line with expectations. With patch, the test delivers 100% PASS. Without the patch, the second test fails:

PASS run_test - [run_test : 40] "From: \\"Demo User\\" <nobody@example.net>\\nMessage-ID: <2@dot.invalid>\\nNewsgroups: dot.test\\nSubject: Bug 170727: Test article with dots\\n\\n. 1 dot\\n.. 2 dots\\n"
                             == "From: \\"Demo User\\" <nobody@example.net>\\nMessage-ID: <2@dot.invalid>\\nNewsgroups: dot.test\\nSubject: Bug 170727: Test article with dots\\n\\n. 1 dot\\n.. 2 dots\\n"
FAIL run_test - [run_test : 56] "From: \\"Demo User\\" <nobody@example.net>\\nMessage-ID: <2@dot.invalid>\\nNewsgroups: dot.test\\nSubject: Bug 170727: Test article with dots\\n\\n.. 1 dot\\n... 2 dots\\n"
                             == "From: \\"Demo User\\" <nobody@example.net>\\nMessage-ID: <2@dot.invalid>\\nNewsgroups: dot.test\\nSubject: Bug 170727: Test article with dots\\n\\n. 1 dot\\n.. 2 dots\\n"
Attachment #9179426 - Attachment is obsolete: true
Attachment #9179426 - Flags: review?(Pidgeot18)
Attachment #9179488 - Flags: review?(Pidgeot18)
Attachment #9179488 - Attachment is obsolete: true
Attachment #9179488 - Flags: review?(Pidgeot18)
Depends on: 1669277

(In reply to Alfred Peters from comment #11)

For that I had to trick a little. Apparently the dot handling in the test server does not work correctly either.

When Bug 1669277 will be fixed, the test works without the /tricks/ ;-)

Attachment #9179655 - Flags: review?(Pidgeot18)

(In reply to Alfred Peters from comment #12)

Created attachment 9179655 [details] [diff] [review]

review? Joshua Cranmer

I took him because he was suggested by Buzilla and he has written this code once. But he is absent since august.
The other suggestion was 'neil' but he had already 22 reviews in queue.

So would anybody else do the review of this and bug 1669277?

Attachment #9179655 - Flags: review?(benc)
Status: NEW → ASSIGNED
Comment on attachment 9179655 [details] [diff] [review] Remove the escaped dot from body lines before saving in the offline store. Review of attachment 9179655 [details] [diff] [review]: ----------------------------------------------------------------- Looks great! ::: mailnews/news/src/nsNNTPProtocol.cpp @@ -2013,5 @@ > } else // we aren't finished with the message yet > { > uint32_t count = 0; > > // skip over the quoted '.' I'd probably add a comment with the term "dot-stuffing" (or a link to https://tools.ietf.org/html/rfc3977#section-3.1.1, say) for the benefit of future archeologists. ::: mailnews/news/test/unit/postings/post3.eml @@ +3,5 @@ > +Newsgroups: dot.test > +Subject: Bug 170727: Test article with dots > + > +. 1 dot > +.. 2 dots I'd probably slip in a few more nasty cases to give it a good workout, eg: ===== . 1 dot .. 2 dots .indented dot . no - that wasn't the end of the message! =====
Attachment #9179655 - Flags: review?(benc)
Attachment #9179655 - Flags: review?(Pidgeot18)
Attachment #9179655 - Flags: review+

(In reply to Ben Campbell from comment #14)

I'd probably add a comment with the term "dot-stuffing" (or a link to
https://tools.ietf.org/html/rfc3977#section-3.1.1, say) for the benefit of
future archeologists.
Done.

I'd probably slip in a few more nasty cases to give it a good workout, eg:
Done.

Attachment #9179655 - Attachment is obsolete: true
Attachment #9184980 - Flags: review+

Please remember to run ./mach eslint --fix <path> and ./mach clang-format -p <path>.

Target Milestone: --- → 84 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/2ad1ef8c60f4
Remove the escaped dot from body lines before saving in the offline store so dot at the beginning of news posts won't be doubled. r=benc

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

But thanks for the patches! Keep 'em coming! ;)

Comment on attachment 9184980 [details] [diff] [review]
Remove the escaped dot from body lines before saving in the offline store.

[Approval Request Comment]
User impact if declined: per bug summary
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): not very risky, but should be uplifted together with bug 1669277

Attachment #9184980 - Flags: approval-comm-esr78?
Attachment #9184980 - Flags: approval-comm-beta?

Comment on attachment 9184980 [details] [diff] [review]
Remove the escaped dot from body lines before saving in the offline store.

[Triage Comment]
Approved for esr78 - needs to be taken with the other patch for 78.
We don't plan another beta for uplifts - so this will appear in beta 84

Attachment #9184980 - Flags: approval-comm-esr78?
Attachment #9184980 - Flags: approval-comm-esr78+
Attachment #9184980 - Flags: approval-comm-beta?
Attachment #9184980 - Flags: approval-comm-beta-
Regressions: 1793313
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: