Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec: Allow updating userBiddingSignals. #907

Merged
merged 3 commits into from
Nov 21, 2023
Merged

Conversation

HabibiYou
Copy link
Contributor

@HabibiYou HabibiYou commented Nov 15, 2023

Protected Audience now allows an interest group's userBiddingSignals property to be updated
when an interest group update occurs (see change here).


Preview | Diff

@JensenPaul JensenPaul added the spec Relates to the spec label Nov 15, 2023
spec.bs Outdated
<dt>"`userBiddingSignals`"
<dd>
1. If |value| is a [=string=],
set |ig|'s [=interest group/user bidding signals=] to the result of [=parse a JSON
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only problem here is that parse a JSON string to an Infra value expects to be called within a valid ES realm (since it can throw errors, and it operates on JS objects). Unfortunately, this algorithm mostly runs in parallel (while at least one time, it does not). That doesn't seem great, although I realize this algorithm already has this bug from several lines above where we already call this algorithm.

This is in contrast with the Chromium implementation, which uses JSONStringValueSerializer which is vacuumed-off logic isolated from v8 and everything. I believe @jyasskin has raised this issue other times in this specification (maybe looking into a realm-agnostic method of doing the same thing), but I can't find any bugs on this spec, Web IDL, or Infra that represents this. Jeffrey, do you think we could benefit from JSON algorithms that aren't tied to a realm? In the meantime, I'm wondering if we should file a bug on this spec, and tag each instance of this with that bug for tracking.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a bug for this and noting it everywhere we parse JSON [=in parallel=] SGTM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infra should really let us do this: whatwg/infra#625.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jyasskin had a comment about we cannot create JS objects [=in parallel=]. For parsing JSON to infra value, "[=parse a JSON string to an Infra value=] involve creating JS objects also, but because those objects don't escape, it's clear how to implement it without actually creating them".

So we only moved [=parsing JSON bytes to a JavaScript value=] to algorithms that are within single realm, but kept [=parse a JSON string to an Infra value=] in algorithms that run [=in parallel=]. But a "realm-agnostic method" to parse json would be great.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for filing that, I couldn't remember if you had already filed something like that or not. OK I think we should make an Issue: block next to this algorithm's usage and point to whatwg/infra#625 from there.

spec.bs Outdated
<dt>"`userBiddingSignals`"
<dd>
1. If |value| is a [=string=],
set |ig|'s [=interest group/user bidding signals=] to the result of [=parse a JSON
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a bug for this and noting it everywhere we parse JSON [=in parallel=] SGTM.

spec.bs Outdated Show resolved Hide resolved
@domfarolino domfarolino merged commit ec354d7 into WICG:main Nov 21, 2023
2 checks passed
github-actions bot added a commit that referenced this pull request Nov 21, 2023
SHA: ec354d7
Reason: push, by domfarolino

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit to MattMenke2/turtledove that referenced this pull request Nov 21, 2023
SHA: ec354d7
Reason: push, by MattMenke2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Relates to the spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants