Closed Bug 1787789 Opened 2 years ago Closed 2 years ago

Refreshing list of newsgroups stops if group name contains multiple consecutive dots

Categories

(MailNews Core :: Networking: NNTP, defect)

Thunderbird 105
defect

Tracking

(thunderbird_esr102 fixed, thunderbird105 fixed)

RESOLVED FIXED
106 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird105 --- fixed

People

(Reporter: welpy-cw, Assigned: rnons)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0

Steps to reproduce:

Refresh group list of Astraweb News Server.

Actual results:

Listing of groups is incomplete. Error Console shows

NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsISubscribableServer.addTo] NntpIncomingServer.jsm:154
addTo resource:///modules/NntpIncomingServer.jsm:154
addNewsgroupToList resource:///modules/NntpIncomingServer.jsm:409
onData resource:///modules/NntpService.jsm:111
read resource:///modules/LineReader.jsm:51
_actionReadData resource:///modules/NntpClient.jsm:700
_onData resource:///modules/NntpClient.jsm:191
Subscribe chrome://messenger/content/mailCommands.js:436
MsgSubscribe chrome://messenger/content/mailWindowOverlay.js:2356
oncommand chrome://messenger/content/messenger.xhtml:1

mailnews.nntp: Failed to process server response [object Object].
Exception { name: "NS_ERROR_ILLEGAL_VALUE", message: "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsISubscribableServer.addTo]", result: 2147942487, filename: "resource:///modules/NntpIncomingServer.jsm", lineNumber: 154, columnNumber: 0, data: null, stack: "addTo@resource:///modules/NntpIncomingServer.jsm:154:24\naddNewsgroupToList@resource:///modules/NntpIncomingServer.jsm:409:10\ngetListOfGroupsOnServer/</client.onData@resource:///modules/NntpService.jsm:111:16\nread@resource:///modules/LineReader.jsm:51:19\n_actionReadData@resource:///modules/NntpClient.jsm:700:22\n_onData@resource:///modules/NntpClient.jsm:191:12\nSubscribe@chrome://messenger/content/mailCommands.js:436:10\nMsgSubscribe@chrome://messenger/content/mailWindowOverlay.js:2356:14\noncommand@chrome://messenger/content/messenger.xhtml:1:1\n", location: XPCWrappedNative_NoHelper }
NntpClient.jsm:193:20

Expected results:

Listing should be complete.

Further examination by adding a console.log(name) in function addTo(...) of NntpIncomingServer (line 154 of NntpIncomingServer.jsm) showed a newsgroup named "alt.binaries.sounds..mp3.zappa" to be the cause.

A simple

if (name.includes(".."))
return;

avoids the mentioned error.

Thunderbird 105.0b1 (64-bit), Windows 10

Even better maybe would be to change the addTo(...) function to something like this:

  addTo(name, addAsSubscribed, subscribale, changeIfExists) {
    try {
      this._subscribable.addTo(
        name,
        addAsSubscribed,
        subscribale,
        changeIfExists
      );
    } catch (e) {
      console.log("Cannot process newsgroup name", name, e);
      return;
    }
    this._groups.push(name);
  }

This would prevent storing the strangly named groups elsewhere, so you won't be able to still search for ".." and (unsuccessfully) try to subscribe to them.

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Thunderbird/105.0

Flags: needinfo?(remotenonsense)
Assignee: nobody → remotenonsense
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

newsgroup named "alt.binaries.sounds..mp3.zappa" to be the cause.

Is that a real group though? What did Thunderbird 91 do? (mailnews.nntp.jsmodule false)

(In reply to Magnus Melin [:mkmelin] from comment #3)

newsgroup named "alt.binaries.sounds..mp3.zappa" to be the cause.

Is that a real group though? What did Thunderbird 91 do? (mailnews.nntp.jsmodule false)

Under TB 91 the tree gets completely built without any error thrown, omitting those groups containing multiple consecutive dots. However searching for ".." let them show up, though trying to subscribe eventually throws an error (see screenshots).

While I really don't have any need for these groups, I can imagine them being included in the group lists of several other news servers as well, which carry just about every newsgroup ever created ...

Attachment #9292468 - Attachment description: Screenshot: searching for groups containing ".." → Screenshot: searching for groups containing ".." (TB 91)
Blocks: 1788572
Flags: needinfo?(remotenonsense)
Target Milestone: --- → 106 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/a117373cebce
Catch error when adding unsupported newsgroup. r=mkmelin

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

Comment on attachment 9292377 [details]
Bug 1787789 - Catch error when adding unsupported newsgroup. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug nntp-js
User impact if declined: Group name with two consecutive dot (e.g. alt.binaries.sounds..mp3.zappa) doesn't work
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): no risk

Attachment #9292377 - Flags: approval-comm-beta?

Comment on attachment 9292377 [details]
Bug 1787789 - Catch error when adding unsupported newsgroup. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9292377 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9292377 [details]
Bug 1787789 - Catch error when adding unsupported newsgroup. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug nntp-js
User impact if declined: Group name with two consecutive dot (e.g. alt.binaries.sounds..mp3.zappa) doesn't work
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): no risk

Attachment #9292377 - Flags: approval-comm-esr102?

Comment on attachment 9292377 [details]
Bug 1787789 - Catch error when adding unsupported newsgroup. r=mkmelin

[Triage Comment]
approved for esr102

Attachment #9292377 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: