Closed Bug 1792362 Opened 2 years ago Closed 2 years ago

"Get Messages" dropdown > News server name doesn't fetch new messages

Categories

(MailNews Core :: Networking: NNTP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird106 affected)

RESOLVED FIXED
107 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird106 --- affected

People

(Reporter: b2, Assigned: rnons)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Steps to reproduce:

On a server that is configured not to fetch messages automatically, fetching messages manually via the "Get Messages" button doesn't work in TB 102.

Clicking onto the server in the folder tree and selecting "Get Messages" from the context menu still works.

The two menu items do different things: MsgGetMessagesForAccount(event.target._folder) and MsgGetMessage() respectively.

Flags: needinfo?(remotenonsense)

The problems is more complicated: Selecting the news server from "Get Messages" button dropdown does retrieve messages when the root folder is selected in the folder tree, it doesn't download when a newsgroup is selected. In case where the download happens (server selected in folder tree), the newsgroup which receives new messages doesn't get the yellow biff symbol, so it appears that nothing was downloaded.

Summary: "Get Messages" dropdown > News server name doesn't fetch new messages any more → "Get Messages" button dropdown > Select news server name: doesn't fetch new messages when server not selected in folder tree, no biff indication
Assignee: nobody → remotenonsense
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Seems to be a quite old problem.

Flags: needinfo?(remotenonsense)

(In reply to Ping Chen (:rnons) from comment #3)

Seems to be a quite old problem.

Indeed, thanks for fixing it!

Out of interest, why was this block moved up?

  nsCOMPtr<nsINntpIncomingServer> nntpServer;
  rv = GetNntpServer(getter_AddRefs(nntpServer));
  NS_ENSURE_SUCCESS(rv, rv);

(In reply to b2 from comment #5)

Out of interest, why was this block moved up?

  nsCOMPtr<nsINntpIncomingServer> nntpServer;
  rv = GetNntpServer(getter_AddRefs(nntpServer));
  NS_ENSURE_SUCCESS(rv, rv);

Reverted, I was trying to get nsIMsgIncomingServer from nntpServer at first, later found GetServer can be used.

Target Milestone: --- → 107 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/30cbbf5e4bdd
Fix fetching nntp messages from Get Messages dropdown. r=mkmelin,benc

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

Sorry about revisiting this. There are four UI elements to get news messages:

First:
Context menu: MsgGetMessage(). That gets messages for the selected newsgroup or the all newsgroups on the selected server.

Second:
Top level button "Get Messages": MsgGetMessagesForAccount(). With no folder, that maps to MsgGetMessage() via
https://searchfox.org/comm-central/rev/e6fd9cc854a8043e277b6846cf28d8f6f7a159c0/mail/base/content/mailWindowOverlay.js#1889
https://searchfox.org/comm-central/rev/e6fd9cc854a8043e277b6846cf28d8f6f7a159c0/mail/base/content/mail3PaneWindowCommands.js#695

Third:
First menu entry on drop down: Get All New Messages (cmd_getMsgsForAuthAccounts): Appears to do nothing for news, regardless of folder tree selection. Note: When a NG is visited later, that NG is retrieved, so this adds to the confusion.

Fourth:
Server entries on the drop down: MsgGetMessagesForAccount(event.target._folder): That's the function that was fixed. Now gets all newsgroups on the selected server. However, it also gets all newsgroups on the server, even if a newsgroup is selected in the folder tree. Is this intended? Looking at the code
https://searchfox.org/comm-central/rev/e6fd9cc854a8043e277b6846cf28d8f6f7a159c0/mailnews/news/src/nsNewsFolder.cpp#799-814
it's meant just to get the selected newsgroup. (That's with the patch applied to a 102 ESR build).

Reopen this bug or new bug? Sorry about the deficient initial bug report.

Flags: needinfo?(remotenonsense)

Debugged "fourth" a bit: Regardless of newsgroup or server selection in the tree, isNewsServer is always returned true here:
https://searchfox.org/comm-central/rev/e6fd9cc854a8043e277b6846cf28d8f6f7a159c0/mailnews/news/src/nsNewsFolder.cpp#788

Note that comment #2 was wrong. We got confused by the newsgroups fetching new messages when their folder is opened. Hence reverting the summary.

Summarising: "First" and "Fourth" are likely OK. "Second" is a bit surprising since despite the tooltip, if a newsgroup is selected, only the newsgroup is fetched, not all newsgroups on the server. "Third" is broken.

Summary: "Get Messages" button dropdown > Select news server name: doesn't fetch new messages when server not selected in folder tree, no biff indication → "Get Messages" dropdown > News server name doesn't fetch new messages

it also gets all newsgroups on the server, even if a newsgroup is selected in the folder tree. Is this intended?

Yes, it's intended, since the menu item is the server name, I interpret it as fetching all subscribed groups on that server.

I don't know if we want to change the behavior of the 2nd, please open a new bug for it.

I will make a new patch here to fix the 3rd.

Thank you for the comment and the fix.

(In reply to Ping Chen (:rnons) from comment #10)

I don't know if we want to change the behavior of the 2nd, please open a new bug for it.
I will make a new patch here to fix the 3rd.

It's debatable what a button click on "Get Messages" should do. The label matches "Get Messages" on the context menu, so maybe the behaviour should be the same. It's only unfortunate that the tooltip isn't clear.

Flags: needinfo?(remotenonsense)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/fb2dec42c8e0
Get All New Messages button should work for nntp servers. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED

Please backport to ESR 102 (like bug 1794185).

Flags: needinfo?(remotenonsense)

Comment on attachment 9297067 [details]
Bug 1792362 - Get All New Messages button should work for nntp servers. r=mkmelin

Request for the two patches.
[Approval Request Comment]
Regression caused by (bug #): old bug
User impact if declined: "Get Messages" dropdown doesn't work for nntp servers.
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): low

Flags: needinfo?(remotenonsense)
Attachment #9297067 - Flags: approval-comm-esr102?

Comment on attachment 9297067 [details]
Bug 1792362 - Get All New Messages button should work for nntp servers. r=mkmelin

[Triage Comment]
Approved for esr102

Attachment #9297067 - 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: