WebExtension online news queries never complete on the default NNTP port
Categories
(MailNews Core :: Networking: NNTP, defect)
Tracking
(Not tracked)
People
(Reporter: welpy-cw, Assigned: welpy-cw)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
Steps to reproduce:
- Configure an NNTP account using the default port, 119, with a known article on the server.
- 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.
| Assignee | ||
Comment 1•17 days ago
|
||
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.
Updated•16 days ago
|
| Assignee | ||
Updated•16 days ago
|
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
Description
•