Skip to content

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

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.

spec.bs Outdated

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 Author

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!

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

spec.bs Outdated

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.

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.
@alexmturner alexmturner force-pushed the aggregate_error_reporting branch from de7b139 to 80e2d7c Compare March 19, 2025 01:39
@alexmturner
Copy link
Collaborator Author

Thanks for the review! Fixed the build and updated the 'uncaught exception' test.

aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 19, 2025
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 <alexmt@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1434576}
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.

3 participants