Skip to content

Conversation

@martinthomson
Copy link
Member

@martinthomson martinthomson commented Dec 4, 2025

This includes a bunch of values that I essentially made up. Rationale for that is listed in #174.
We'll have to discuss what appropriate values are
before we can merge this change.

Closes #174.


Preview | Diff

This includes a bunch of values that I essentially made up.
Rationale for that is listed in #174.
We'll have to discuss what appropriate values are
before we can merge this change.

Closes #174.
Copy link
Collaborator

@apasel422 apasel422 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec and simulator changes here LGTM, though I'll defer to others on the choice of the exact minimum values mandated by the spec.

Comment on lines 5 to +8
"maxConversionSitesPerImpression": 3,
"maxConversionCallersPerImpression": 3,
"maxImpressionSitesForConversion": 3,
"maxImpressionCallersForConversion": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know setting lower values here simplifies test construction, but it may be confusing to anyone stumbling across this code for them to be less than the minimums mandated by the specification. I'm OK with keeping them this low for now, but we might want to add a $comment noting this.

limit: number,
): Set<string> {
const parsed = new Set<string>();
if (limit !== null && input.length > limit) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (limit !== null && input.length > limit) {
if (input.length > limit) {

The limit !== null condition is redundant with limit: number above, which makes the value non-nullable.

Comment on lines +92 to 95
/// The maximum number of conversion callers per impression.
readonly maxConversionSitesPerImpression: number;
/// The maximum number of conversion sites per impression.
readonly maxConversionCallersPerImpression: number;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The maximum number of conversion callers per impression.
readonly maxConversionSitesPerImpression: number;
/// The maximum number of conversion sites per impression.
readonly maxConversionCallersPerImpression: number;
/// The maximum number of conversion sites per impression.
readonly maxConversionSitesPerImpression: number;
/// The maximum number of conversion callers per impression.
readonly maxConversionCallersPerImpression: number;

const maxMatchValues = this.#delegate.maxMatchValues;
if (matchValues.length > maxMatchValues) {
throw new RangeError(
`matchValues size must be in the range [0,${maxMatchValues}]`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`matchValues size must be in the range [0,${maxMatchValues}]`,
`number of values in matchValues exceeds limit of ${maxMatchValues}`,

To match the error format for parseSites, and because there can't be fewer than 0 entries in the list.

},
"maxConversionSitesPerImpression": 3,
"maxConversionCallersPerImpression": 3,
"maxImpressionSitesForConversion": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to update impl/e2e.schema.json as well with the new configuration fields.

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.

Size checks for lists passed to the API

3 participants