Closed Bug 1806802 Opened 1 year ago Closed 1 year ago

Support "network.responseCompleted" for cached responses

Categories

(Remote Protocol :: WebDriver BiDi, task, P1)

task
Points:
2

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

(Whiteboard: [webdriver:m6], [wptsync upstream] [webdriver:relnote])

Attachments

(1 file, 1 obsolete file)

Similarly to Bug 1806794, we will handled cached responses after the basic implementation is done. We should wait for Bug 1806794 to be fixed so that we can easily add tests for this.

There is only one trigger for response completed, so this should hopefully be easier.

Points: --- → 2

I am planning to disable the 304 test case for response completed over at https://bugzilla.mozilla.org/show_bug.cgi?id=1810302 because it seems to fail very frequently on android.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Hi Valentin,

Quick question about checking if a response comes from the local cache.
At the moment, DevTools is mostly relying on the fact that the channel was detected by a http-on-examine-cached-response notification. For BiDi, I initially wanted to rely more on channel APIs, in this case nsICacheInfoChannel.isFromCache.

But when adding test cases, I don't always get the expected value from this API. For cached 200 OK responses it seems to work fine. However I was also testing with a 301 Moved Permanently response and here I always get false from nsICacheInfoChannel.isFromCache.

From BiDi's point of view we mark requests as cached if the response's cache state is local. Do you think I should be able to consistently use nsICacheInfoChannel.isFromCache to get this information, or should I rather follow the DevTools approach and just rely on the http-on-examine-cached-response notification?

Maybe I am calling the API at the wrong time, but I would expect it to return undefined in this case, whereas here it returns false.

Flags: needinfo?(valentin.gosu)

Comment on attachment 9320893 [details]
Bug 1806802 - Support "network.response" events for cached responses

Revision D171508 was moved to bug 1806794. Setting attachment 9320893 [details] to obsolete.

Attachment #9320893 - Attachment is obsolete: true

(In reply to Julian Descottes [:jdescottes] from comment #2)

Hi Valentin,

Quick question about checking if a response comes from the local cache.
At the moment, DevTools is mostly relying on the fact that the channel was detected by a http-on-examine-cached-response notification. For BiDi, I initially wanted to rely more on channel APIs, in this case nsICacheInfoChannel.isFromCache.

But when adding test cases, I don't always get the expected value from this API. For cached 200 OK responses it seems to work fine. However I was also testing with a 301 Moved Permanently response and here I always get false from nsICacheInfoChannel.isFromCache.

Are you checking nsICacheInfoChannel.isFromCache during onStartRequest, or some other notification?
If it's onStartRequest it likely wouldn't work, because we don't send onStartRequest for the 301 response, but for the final response after the redirect.
I think the attribute should return the correct value when called from OnExamineResponse - but I haven't checked.
If you have a failing test case I can add it to bug 1817750.

Flags: needinfo?(valentin.gosu)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/42ef14d95f27
[wdspec] Add wdspec test for cached responseCompleted events r=webdriver-reviewers,whimboo,jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/39031 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m6] → [webdriver:m6], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1823034
Whiteboard: [webdriver:m6], [wptsync upstream] → [webdriver:m6], [wptsync upstream] [webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: