Closed Bug 1887118 Opened 2 years ago Closed 1 month ago

Network event cookies are missing all properties except name and value

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect
Points:
5

Tracking

(firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 3 open bugs)

Details

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

Attachments

(2 files)

The current network event cookies only contain name and value on Firefox.
They should be regular network.Cookie objects:

network.Cookie = {
    name: text,
    value: network.BytesValue,
    domain: text,
    path: text,
    size: js-uint,
    httpOnly: bool,
    secure: bool,
    sameSite: network.SameSite,
    ? expiry: js-uint,
    Extensible,
};

https://w3c.github.io/webdriver-bidi/#serialize-cookie

I think we discussed this limitation when we implemented the events, but I don't think we filed bugs or wrote tests about it.

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)

Hi Valentin,

Right now we parse the headers from the channel (using visitRequestHeaders) and when we spot the cookie header, we simply parse it to extract name and values of the cookies.

Do you know if there is any API which we could use to easily get full details about the cookies for a given request (eg samesite, issecure, etc...). Otherwise we would use various APIs from Services.cookies but I wanted to check first with you if there was a better approach.

Severity: -- → S3
Flags: needinfo?(hskupin) → needinfo?(valentin.gosu)
Priority: -- → P3
Whiteboard: [webdriver:backlog]

Currently cookies are added to the request this way:
HttpBaseChannel::AddCookiesToRequest -> GetCookieStringFromHttp -> GetCookiesForURI.

I'm thinking you could use getCookiesFromHost to get all the cookies - they might need to be sorted through to make sure we don't send the ones we don't have to, like GetCookiesForURI does.

Alternatively, you could create a XPIDL binding for ParseAttributes, and use that to parse the cookie header set on the request. I think that might be easier.

Flags: needinfo?(valentin.gosu)

This issue prevents a client library that relies on strict compliance with the WebDriver BiDi specification from receiving and processing network events. WebDriverBiDi.NET is one such library, and one of its consumers is Puppeteer Sharp.

Whiteboard: [webdriver:backlog] → [webdriver:backlog][webdriver:triage]
Priority: P3 → P2
Whiteboard: [webdriver:backlog][webdriver:triage] → [webdriver:m20]
Points: --- → 5
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

I have an implementation in progress, but I think we have a conflict between the spec and our current wdspec tests on this topic. https://github.com/w3c/webdriver-bidi/issues/1110

Blocks: 2031237
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/32d6f056e962 https://hg.mozilla.org/integration/autoland/rev/15b6b9eee67c [bidi] Serialize all request cookie properties in network events r=whimboo https://github.com/mozilla-firefox/firefox/commit/cac21417c96a https://hg.mozilla.org/integration/autoland/rev/71f0c2a21d10 [wdspec] Update network tests to check all properties of cookies in event payload r=whimboo
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59228 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m20] → [webdriver:m20], [wptsync upstream]

Upstream PR merged by moz-wptsync-bot

Some issues were spotted with the tests against Chrome, I pushed a PR upstream to fix this https://github.com/web-platform-tests/wpt/pull/59305

Whiteboard: [webdriver:m20], [wptsync upstream] → [webdriver:m20], [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: