-
Notifications
You must be signed in to change notification settings - Fork 28
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: Private Aggregation error reporting #229
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xyaoinum, could you PTAL? Had a question about how best to write this (see comment). Thanks!
Also note that the spec build is failing due to some missing exports, but I have a different PR to fix that in the PAA repo that I'll land first.
spec.bs
Outdated
|
||
: If it was rejected: | ||
:: 1. If |savedQueryName| is a [=string=] that is not the empty string, then run [=store the index for a saved query=] with |window|, |navigable|, |workletDataOrigin|, |moduleURLRecord|, |operationName|, |savedQueryName|, and the [=default selectURL index=]. | ||
1. [=Queue a global task=] on the [=DOM manipulation task source=], given |window|, to [=reject=] |promise| with a {{TypeError}}. | ||
|
||
Note: This indicates that either |operationCtor|'s run() method encounters an error (where |operationCtor| is the parameter in {{SharedStorageWorkletGlobalScope/register()}}), or the result |index| is a non-integer value, which violates the selectURL() protocol, and we don't know which url should be selected. | ||
1. Run |privateAggregationCompletionTask|. | ||
1. If the promise was rejected as the operation was completed abruptly due to an uncaught exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure how to evaluate this properly (in spec language) unless we decide that returning a non-integer should count as an uncaught exception for aggregate error reporting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A non-integer will often be implicitly converted to an integer without error, see test case SelectURL_NonNumericStringConvertedTo0. AFAICT, the only possible integer conversion failure is to return an object that defines a custom toString() method that throws, e.g. SelectURL_ReturnValueToUint32Error. I think it's fine to simply assume 'uncaught exception' here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting -- I've updated this PR to reflect that / remove the unnecessary if clause. I'll try to add a test case for this situation in the implementation too. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
spec.bs
Outdated
|
||
: If it was rejected: | ||
:: 1. If |savedQueryName| is a [=string=] that is not the empty string, then run [=store the index for a saved query=] with |window|, |navigable|, |workletDataOrigin|, |moduleURLRecord|, |operationName|, |savedQueryName|, and the [=default selectURL index=]. | ||
1. [=Queue a global task=] on the [=DOM manipulation task source=], given |window|, to [=reject=] |promise| with a {{TypeError}}. | ||
|
||
Note: This indicates that either |operationCtor|'s run() method encounters an error (where |operationCtor| is the parameter in {{SharedStorageWorkletGlobalScope/register()}}), or the result |index| is a non-integer value, which violates the selectURL() protocol, and we don't know which url should be selected. | ||
1. Run |privateAggregationCompletionTask|. | ||
1. If the promise was rejected as the operation was completed abruptly due to an uncaught exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A non-integer will often be implicitly converted to an integer without error, see test case SelectURL_NonNumericStringConvertedTo0. AFAICT, the only possible integer conversion failure is to return an object that defines a custom toString() method that throws, e.g. SelectURL_ReturnValueToUint32Error. I think it's fine to simply assume 'uncaught exception' here.
Adds support for the new Private Aggregation error reporting feature to Shared Storage. See the related PAA spec change: patcg-individual-drafts/private-aggregation-api#172 Also see the explainer: https://github.com/patcg-individual-drafts/private-aggregation-api/blob/main/error_reporting.md Slightly reorganizes the PAA integration with this spec for readability.
de7b139
to
80e2d7c
Compare
Thanks for the review! Fixed the build and updated the 'uncaught exception' test. |
Adds support for the new feature and its contributeToHistogramOnEvent() method. Requires plumbing the cause of a Shared Storage operation completing to the PrivateAggregation object to support contributions conditional on an uncaught exception. Spec PR: WICG/shared-storage#229 Bug: 381788013 Change-Id: I42a3a2e21a948263a22f5b439c0ec92ef9791932 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6334249 Commit-Queue: Alex Turner <[email protected]> Reviewed-by: Yao Xiao <[email protected]> Cr-Commit-Position: refs/heads/main@{#1434576}
Adds support for the new Private Aggregation error reporting feature to Shared Storage. See the related PAA spec change:
patcg-individual-drafts/private-aggregation-api#172. Also see the explainer:
https://github.com/patcg-individual-drafts/private-aggregation-api/blob/main/error_reporting.md
Slightly reorganizes the PAA integration with this spec for readability.
Preview | Diff