Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexmturner
Copy link
Collaborator

@alexmturner alexmturner commented Mar 7, 2025

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

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.
Copy link
Collaborator Author

@alexmturner alexmturner left a 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:
Copy link
Collaborator Author

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

Copy link
Collaborator

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.

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


: 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:
Copy link
Collaborator

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants