Closed Bug 2091761 Opened 17 days ago Closed 15 days ago

WebExtension online news queries never complete on the default NNTP port

Categories

(MailNews Core :: Networking: NNTP, defect)

Thunderbird 160
defect

Tracking

(Not tracked)

RESOLVED FIXED
162 Branch

People

(Reporter: welpy-cw, Assigned: welpy-cw)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Steps to reproduce:

  1. Configure an NNTP account using the default port, 119, with a known article on the server.
  2. From a WebExtension with the messagesRead permission, call browser.messages.query({ online: true, accountId, headerMessageId }) with that account and article's Message-ID.

Expected result:
The query resolves with the matching message.

Actual result:
The query remains pending. In retrieveMessageFromServer(), savedPromise never resolves because OnStopRunningUrl is not called.

Cause:
Bug 2080426 switched the query to constructNewsUriSpec(), which omits port 119. This exposes an existing problem in NntpChannel: its constructor adds the port by cloning the supplied URI after the message service has registered a URL listener. nsMsgMailNewsUrl::Clone() does not copy listeners. The channel runs the clone, leaving the original listener without completion notifications.

Proposed fix:
Preserve the supplied URI for channel state and URL notifications. Resolve the effective port separately for port checks and server creation, and normalize the port only on the cache-key URI.

Validation:
A WebExtension regression test using port 119 times out before the fix and passes afterward. A channel regression test checks URI identity, start/stop notifications for server and cache reads, and a shared cache entry for portless and explicit-port URLs. All 32 news unit tests and the WebExtension online-query test pass with the fix; lint reports no errors or warnings.

Keep the supplied channel URI and resolve its effective port separately, normalizing only the cache key. This preserves completion notifications when the port is omitted.

Add coverage for URL listeners on server and cache reads and cache sharing between implicit and explicit ports.

Attachment #9679417 - Attachment description: WIP: Bug 2091761 - Preserve URL listeners for news requests without an explicit port. r=#thunderbird-reviewers → Bug 2091761 - Preserve URL listeners for news requests without an explicit port. r=#thunderbird-reviewers
Target Milestone: --- → 162 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b42ea5871404
Preserve URL listeners for news requests without an explicit port. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 15 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: