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

Fix parsing of our promises to note they're nullable. #1293

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

morlovich
Copy link
Collaborator

@morlovich morlovich commented Oct 4, 2024

(That we were using the wrong types here got exposed by some improvements to Chrome's WebIDL impl;
see also https://chromium-review.googlesource.com/c/chromium/src/+/5907125)


Preview | Diff

@morlovich
Copy link
Collaborator Author

Note: the renderered diff link doesn't show the WebIDL changes.

@morlovich morlovich added the spec Relates to the spec label Oct 4, 2024
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated
@@ -1346,13 +1353,14 @@ To <dfn>validate and convert auction ad config</dfn> given an {{AuctionAdConfig}
* To parse the value |result|:
1. Set |auctionConfig|'s [=auction config/per buyer signals=] to a new [=ordered map=] whose
Copy link
Collaborator

Choose a reason for hiding this comment

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

so it always sets |auctionConfig|'s [=auction config/per buyer signals=] to a map, and not setting it to null when |result| is null. In our code, we have optional for these fields (example: per_buyer_currencies), but seems no much difference, right? (if so, seems currently in spec these map fields can never be null, where their definitions say they could)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I am just wrong here, and we do pass null through --- not sure why I misread code that way. Thanks!
(Will get back to this in a bit, need to finish other task first)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed. Looks like deprecatedRenderURLReplacement doesn't do nullability, though.
The difference is whether we add the field when we serialize the config back to seller worklet or not.
So observable, but somewhat less important than what motivated this CL --- saying that resolving these promises with null or undefined (rather than empty objects) when you want nothing is acceptable.

Copy link
Collaborator

@qingxinwu qingxinwu Oct 7, 2024

Choose a reason for hiding this comment

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

is it worthwhile changing deprecatedRenderURLReplacement's implementation?

spec.bs Outdated
given |value|.
1. [=map/Set=] |auctionConfig|'s [=auction config/per buyer signals=][|buyer|] to
|signalsString|.
1. If |result| is not null:
Copy link
Collaborator

@qingxinwu qingxinwu Oct 4, 2024

Choose a reason for hiding this comment

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

Seems we need to set |auctionConfig|'s [=auction config/per buyer signals=] to null when |result| is null explicitly, since it has no default value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

... probably need to set it to that on all regardless of default because we set it to the promise first.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@JensenPaul JensenPaul merged commit feb9171 into WICG:main Oct 11, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Oct 11, 2024
SHA: feb9171
Reason: push, by JensenPaul

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
HabibiYou pushed a commit to HabibiYou/turtledove that referenced this pull request Oct 29, 2024
* Fix parsing of our promises to note they're nullable.

* Propagate nulls further.

* Actually set the nulls.

---------

Co-authored-by: Maks Orlovich <[email protected]>
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.

3 participants