Perform SW upgrade before http-on-before-connect
Categories
(Core :: Networking, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: [necko-triaged][necko-priority-next][webdriver:m11])
Attachments
(1 file)
With Bug 1880803, the NetworkObserver can create network events as early as http-on-before-connect. However at that point requests which are supposed to be handled by a service worker are still using an early channel that will be swapped with another channel (but keeping the same channelId) later.
With our current implementation, the NetworkObserver sets up a Response listener as soon as we detect the channel (here), but since the channel is going to be replaced later on, this leads to various issues.
If the SW upgrade could be performed before http-on-before-connect, then we would always deal with the "final" channel and this would simplify handling of service worker requests for DevTools and BiDi.
Assignee | ||
Comment 1•1 month ago
|
||
Discussed about this with :Valentin on slack. If this proves difficult to change, let me know, I can probably try to handle it differently in the NetworkObserver.
I think this should be as easy as moving the lines here https://searchfox.org/mozilla-central/rev/ccb101be8f27d837b655ccee51a52c0337dd1eb8/netwerk/protocol/http/nsHttpChannel.cpp#879-881 to line 863, just before calling OnBeforeConnect.
If this doesn't cause any issues on try it should be easy to land... otherwise we might have to figure out how things should really work :)
Assignee | ||
Comment 3•1 month ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #2)
I think this should be as easy as moving the lines here https://searchfox.org/mozilla-central/rev/ccb101be8f27d837b655ccee51a52c0337dd1eb8/netwerk/protocol/http/nsHttpChannel.cpp#879-881 to line 863, just before calling OnBeforeConnect.
If this doesn't cause any issues on try it should be easy to land... otherwise we might have to figure out how things should really work :)
Just tried it locally and it seems to work fine, and it fixes my issues with service worker requests in WebDriver BiDi! I'll check if try is happy with this.
Assignee | ||
Comment 4•1 month ago
|
||
Updated•1 month ago
|
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dfa0c6371ff0 Upgrade service worker request before http-on-before-connect r=valentin,necko-reviewers,asuth
Comment 6•1 month ago
|
||
bugherder |
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Description
•