The default bug view has changed. See this FAQ.

nsNntpIncomingServer allows to subscribe twice to the same newsgroup

RESOLVED FIXED in Thunderbird 19.0

Status

MailNews Core
Networking: NNTP
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: tessarakt, Assigned: aceman)

Tracking

Trunk
Thunderbird 19.0
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
Build ID: 20120905151427

Steps to reproduce:

When writing a test, I run across the following issue (already posted on mozilla.dev.app.thunderbird):

"When calling server.subscribeToNewsgroup(ng) twice with the same 
newsgroup, it gets subscribed twice. That means that 
server.rootFolder.subFolders contains the same newsgroup twice.

Is that intended behavior?"

Magnus Melin replied (by mail only): "No, sounds like a bug."

So this should be fix, even if there might be no way to trigger this from UI.
(Assignee)

Comment 1

5 years ago
The subscribeToNewsGroup seems to be defined here:
http://hg.mozilla.org/comm-central/file/f7c185914146/mailnews/news/src/nsNntpIncomingServer.cpp#l746

It could be enough to call ContainsNewsgroup (http://hg.mozilla.org/comm-central/file/f7c185914146/mailnews/news/src/nsNntpIncomingServer.cpp#l724) from subscribeToNewsGroup.

There only needs to be decision what return value the function returns if the newsgroup already exists.
It could be an error, but I propose it could also be a success (as the wanted newsgroup is now subscribed as the caller wanted).
Assignee: nobody → acelists
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

5 years ago
Created attachment 666715 [details] [diff] [review]
patch

Jens, can you try if this patch fixes it for you?
Attachment #666715 - Flags: feedback?(blog)
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Attachment #666715 - Flags: review?(Pidgeot18)
Comment on attachment 666715 [details] [diff] [review]
patch

Review of attachment 666715 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the delay in reviewing this.
Attachment #666715 - Flags: review?(Pidgeot18) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/dbdb0f38e089
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 19.0
Depends on: 803574
(Reporter)

Comment 5

5 years ago
Hi aceman,

sorry, I am currently in the process of moving, and don't have access to my Linux machine with the comm-central checkout at the moment. So I cannot give feedback at the moment.

Jens
(Assignee)

Updated

4 years ago
Attachment #666715 - Flags: feedback?(blog)
You need to log in before you can comment on or make changes to this bug.