-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Spec: Private Aggregation error reporting #229
base: main
Are you sure you want to change the base?
Conversation
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.
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.
|
||
: 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.
LGTM
|
||
: 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.
Preview | Diff