Skip to content

Commit

Permalink
Spec: minor fixes (#122)
Browse files Browse the repository at this point in the history
Fixes some minor issues discovered in the spec, also adds some Issue
comments to track some potential future clean ups.
  • Loading branch information
alexmturner authored Mar 29, 2024
1 parent 4552911 commit e4ab73c
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ dictionary PADebugModeOptions {
};
</xmp>

Issue: Per the <a href=https://www.w3.org/TR/design-principles/#numeric-types>
Web Platform Design Principles</a>, we should consider switching `long` to
`[EnforceRange] long long`.

Issue: {{PrivateAggregation/enableDebugMode(options)}}'s argument should not
have a default value of `{}`. Alternatively, {{PADebugModeOptions/debugKey}}
should not be required in {{PADebugModeOptions}}.

Each {{PrivateAggregation}} object has the following fields:
<dl dfn-for="PrivateAggregation">
: <dfn>scoping details</dfn> (default null)
Expand Down Expand Up @@ -1048,12 +1056,12 @@ steps. They return an [=aggregation coordinator=], null or a {{DOMException}}:
To <dfn algorithm>obtain the context ID</dfn> given a
{{SharedStorageRunOperationMethodOptions}} |options|, perform the following
steps. They return a [=string=], null, or a {{DOMException}}:
1. If |options|["`privateAggregationConfig`"] does not [=map/exist=], return
null.
1. If |options|["`privateAggregationConfig`"]["`contextId`"] does not [=map/
exist=], return null.
1. Set |contextId| to
|options|["`privateAggregationConfig`"]["`contextId`"].
1. If |options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]
does not [=map/exist=], return null.
1. If |options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/contextId}}"]
does not [=map/exist=], return null.
1. Let |contextId| be
|options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/contextId}}"].
1. If |contextId|'s [=string/length=] is greater than 64, return a new
{{DOMException}} with name "`DataError`".
1. Return |contextId|.
Expand Down Expand Up @@ -1294,12 +1302,23 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
value=], [=exception/throw=] a {{TypeError}}.
1. If |bucket|["{{PASignalValue/offset}}"] is not a {{bigint}}, [=exception/
throw=] a {{TypeError}}.
1. Otherwise, if |contribution|["{{PAExtendedHistogramContribution/bucket}}"] is
not in the range [0, 2<sup>128</sup>−1], [=exception/throw=] a
{{TypeError}}.

Issue: Make the error type consistent with
{{PrivateAggregation/contributeToHistogram(contribution)}}.
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
1. If |value| is a {{PASignalValue}}:
1. If |value|["{{PASignalValue/baseValue}}"] is not a valid [=signal base
value=], [=exception/throw=] a {{TypeError}}.
1. If |value|["{{PASignalValue/offset}}"] is a {{bigint}}, [=exception/
throw=] a {{TypeError}}.
1. Otherwise, if |contribution|["{{PAHistogramContribution/value}}"] is
negative, [=exception/throw=] a {{TypeError}}.

Issue: Make the error types on validation issues here and above consistent
with {{PrivateAggregation/contributeToHistogram(contribution)}}.
1. Let |batchingScope| be null.
1. If |event| [=string/starts with=] "`reserved.`", set |batchingScope| to the
result of running |scopingDetails|' [=scoping details/get batching scope
Expand Down Expand Up @@ -1973,10 +1992,10 @@ To <dfn>fill in the contribution</dfn> given a
following steps. They return a {{PAHistogramContribution}}.
1. Let |bucket| be |contribution|["{{PAExtendedHistogramContribution/bucket}}"].
1. If |bucket| is a {{PASignalValue}}, set |bucket| to the result of [=filling
in the signal value=] given |bucket|, 65535 and |leadingBidInfo|.
in the signal value=] given |bucket|, 2<sup>128</sup>−1 and |leadingBidInfo|.
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
1. If |value| is a {{PASignalValue}}, set |value| to the result of [=filling in
the signal value=] given |value|, 2<sup>128</sup>−1 and |leadingBidInfo|.
the signal value=] given |value|, 2<sup>31</sup>−1 and |leadingBidInfo|.
1. Return a new {{PAHistogramContribution}} with the items:
: {{PAHistogramContribution/bucket}}
:: |bucket|
Expand Down

0 comments on commit e4ab73c

Please sign in to comment.