Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject zero as a value for impression lifetime #86

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions api.bs
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ The arguments to <a method for=PrivateAttribution>saveImpression()</a> are as fo
site.
<dt><dfn>lifetimeDays</dfn></dt>
<dd>
A "time to live" (in days) after which the [=impression=] can no longer
receive attribution.
A non-zero "time to live" (in days) after which the [=impression=] can no
longer receive attribution.
If not specified, the default is 30 days.
The [=user agent=] should impose an upper limit on the lifetime,
and silently reduce the value specified here if it exceeds that limit.
Expand All @@ -525,11 +525,17 @@ The arguments to <a method for=PrivateAttribution>saveImpression()</a> are as fo

### Operation ### {#save-impression-api-operation}

Given <a dictionary lt=PrivateAttributionImpressionOptions>|options|</a>:

1. Collect the implicit API inputs:
1. The current timestamp
2. The impression site domain
3. The iframe site domain
1. Validate the page-supplied API inputs
1. The impression site domain
1. The iframe site domain
1. Validate the page-supplied API inputs:
1. If |options|.{{PrivateAttributionImpressionOptions/lifetimeDays}} is 0,
throw a {{RangeError}}.
1. Clamp |options|.{{PrivateAttributionImpressionOptions/lifetimeDays}} to
the [=user agent=]'s upper limit.
1. If the private attribution API is enabled, save the impression to the
[=impression store=].

Expand Down
Loading