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

Update spec for enrollment #105

Merged
merged 7 commits into from
Aug 29, 2023

Conversation

shivanigithub
Copy link
Collaborator

@shivanigithub shivanigithub commented Aug 23, 2023

Update spec for enrollment


Preview | Diff

spec.bs Outdated
@@ -928,6 +929,12 @@ On the other hand, methods for getting data from the [=shared storage database=]
1. If |worklet|'s [=global scopes|list of global scopes=] is [=list/empty=], then return a [=promise rejected=] with a {{TypeError}}.
1. [=Assert=] that |worklet|'s [=global scopes|list of global scopes=] [=list/contains=] a single {{SharedStorageWorkletGlobalScope}}.
1. If the result of running [=SharedStorageWorkletGlobalScope/check whether addModule is finished=] for |worklet|'s {{SharedStorageWorkletGlobalScope}} is false, return a [=promise rejected=] with a {{TypeError}}.
1. Optionally, return a [=promise rejected=] with a {{TypeError}}.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@xyaoinum @pythagoraskitty I wasn't sure if this is the right place for returning an error from selectUrl and the right error type, can you help confirm if this aligns with the implementation or should this return be at an earlier point like in addModule, thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

There seems to be two issues:

  1. In this spec, we only check the user settings during storage getters/setters, but not for addModule()/selectURL()/run(). We should check the user settings for those as well.
  2. In the spec, the Error is always "TypeError". In the code, the error type is sometimes OperationError.

I can send a patch to fix (1) to unblock this patch (or @shivanigithub do you prefer doing the fix along with this patch?). And problem 2 can be addressed separately as it's not only relevant to user setting errors.

spec.bs Outdated
@@ -376,7 +376,8 @@ The Shared Storage API will integrate into the [=Storage Model|Storage API=] as

1. Let |origin| be |environment|'s [=url/origin=].
1. If |origin| is an [=opaque origin=], then return failure.
1. If the user has disabled [=shared storage=], then return failure.
1. If the user has disabled [=shared storage=] or operation is denied due to other user agent defined mechanism e.g. |origin|'s site not being
Copy link
Collaborator

Choose a reason for hiding this comment

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

More precisely, I think this should be |origin|'s [=origin/host=]'s [=host/registrable domain=]?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you add the link to multiple sites, it seems better to add the link to <pre class="anchors"> section at the top, and reference it via [=enrolled=] in the main text.

html; urlPrefix: https://github.com/privacysandbox/attestation
    type: dfn
        text: enrolled

Also, I just noticed it's the schemeful site. So, this can be e.g. the result of [=obtaining a site=] with |origin| not being [=enrolled=].

Copy link
Collaborator

Choose a reason for hiding this comment

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

(FYI I also made a PR to add the settings check for addModule/selectURL/run: #106)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Edited to add this link.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And used something similar to the result of [=obtaining a site=] with |origin| not being [=enrolled=]...

Could probably still be further edited. xyaoinum@ what do you think?

spec.bs Outdated
@@ -928,6 +929,12 @@ On the other hand, methods for getting data from the [=shared storage database=]
1. If |worklet|'s [=global scopes|list of global scopes=] is [=list/empty=], then return a [=promise rejected=] with a {{TypeError}}.
1. [=Assert=] that |worklet|'s [=global scopes|list of global scopes=] [=list/contains=] a single {{SharedStorageWorkletGlobalScope}}.
1. If the result of running [=SharedStorageWorkletGlobalScope/check whether addModule is finished=] for |worklet|'s {{SharedStorageWorkletGlobalScope}} is false, return a [=promise rejected=] with a {{TypeError}}.
1. Optionally, return a [=promise rejected=] with a {{TypeError}}.
Copy link
Collaborator

Choose a reason for hiding this comment

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

There seems to be two issues:

  1. In this spec, we only check the user settings during storage getters/setters, but not for addModule()/selectURL()/run(). We should check the user settings for those as well.
  2. In the spec, the Error is always "TypeError". In the code, the error type is sometimes OperationError.

I can send a patch to fix (1) to unblock this patch (or @shivanigithub do you prefer doing the fix along with this patch?). And problem 2 can be addressed separately as it's not only relevant to user setting errors.

@pythagoraskitty
Copy link
Collaborator

pythagoraskitty commented Aug 23, 2023

Couldn't figure out how to reply inline to your comment above, @xyaoinum, i.e.

There seems to be two issues:

  1. In this spec, we only check the user settings during storage getters/setters, but not for addModule()/selectURL()/run(). We should check the user settings for those as well.
  2. In the spec, the Error is always "TypeError". In the code, the error type is sometimes OperationError.
    I can send a patch to fix (1) to unblock this patch (or @shivanigithub do you prefer doing the fix along with this patch?). And problem 2 can be addressed separately as it's not only relevant to user setting errors.

Anyway, I just approved and merged your fix to (1.)

As for (2.), that's due to feedback from my spec mentor, @wanderview, who had recommended that we not delve too deeply into categorizing various exceptions and just use TypeErrors. But I'm happy to revisit that.

@wanderview
Copy link
Collaborator

As for (2.), that's due to feedback from my spec mentor, @wanderview, who had recommended that we not delve too deeply into categorizing various exceptions and just use TypeErrors. But I'm happy to revisit that.

Maybe the solution is to fix the code to throw TypeError to be in sync with the spec?

Copy link
Collaborator

@xyaoinum xyaoinum left a comment

Choose a reason for hiding this comment

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

LGTM % a nit

spec.bs Outdated Show resolved Hide resolved
Remove transition paragraph
@pythagoraskitty pythagoraskitty merged commit 0d7bffe into WICG:main Aug 29, 2023
1 check passed
github-actions bot added a commit that referenced this pull request Aug 29, 2023
SHA: 0d7bffe
Reason: push, by pythagoraskitty

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants