Duplicated request ids for data URLs or cached images resources
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox146 fixed)
| Tracking | Status | |
|---|---|---|
| firefox146 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
Details
(Whiteboard: [webdriver:m18], [wptsync upstream][webdriver:relnote])
Attachments
(2 files)
Noticed while testing something else, it seems that the ids created for data channels can be identical to ids created for existing (non-data) channels?
Eg I had for the same session:
{
"type": "event",
"method": "network.responseCompleted",
"params": {
"context": "2c9b18ff-a7f5-43bc-aec6-563002b7d9df",
"isBlocked": false,
"navigation": null,
"redirectCount": 0,
"request": {
"request": "52",
"url": "data:text/plain,1",
[...]
},
[...]
}
}
and
{
"type": "event",
"method": "network.responseCompleted",
"params": {
"context": "2c9b18ff-a7f5-43bc-aec6-563002b7d9df",
"isBlocked": false,
"navigation": "3fe27ada-3f1d-4a73-8e82-bdd9e211f6b3",
"redirectCount": 0,
"request": {
"request": "52",
"url": "https://www.wikipedia.org/",
[...]
},
[...]
}
}
So both events have the same id "52".
| Assignee | ||
Comment 1•2 months ago
•
|
||
The request id is set at https://searchfox.org/firefox-main/rev/2c8e9bccfd6ce951ceda8d46ab619f461b7fd0bc/remote/shared/NetworkRequest.sys.mjs#79-84
this.#wrappedChannel = ChannelWrapper.get(channel);
this.#redirectCount = this.#timedChannel.redirectCount;
// The wrappedChannel id remains identical across redirects, whereas
// nsIChannel.channelId is different for each and every request.
this.#requestId = this.#wrappedChannel.id.toString();
So it seems that the wrappedChannel might be reusing ids for data channels which have already been attributed to other channels?
Comment 2•2 months ago
|
||
mozilla::extensions::ChannelWrapper::mId is initialized completely different from mozilla::net::nsHttpHandler::NewChannelId
As far as I can tell, the ChannelWrapper could return the same ID for two different channels if you use them in different processes.
| Assignee | ||
Comment 3•2 months ago
|
||
Good point thanks. ChannelWrapper is preferable for us in a few cases (mostly it stays the same across redirects) but then we need to make sure handle the case where the ids come from different processes.
Data urls and cached resources (images/styles) will be handled in content processes, while the rest will be handled in the parent. We could prefix it with a process id. Ideally in each process we could build a ChannelWrapper mId -> UUID, but I'm not sure when we could cleanup the entries so I'm concerned it would grow indefinitely.
| Assignee | ||
Comment 4•2 months ago
|
||
This potentially impacts any channel handled in content processes.
| Assignee | ||
Comment 5•2 months ago
|
||
Updated•2 months ago
|
| Assignee | ||
Comment 6•2 months ago
|
||
| Assignee | ||
Updated•2 months ago
|
https://hg.mozilla.org/mozilla-central/rev/b77bbd8a24a2
https://hg.mozilla.org/mozilla-central/rev/801c3e7a4ad3
Updated•12 days ago
|
Description
•