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

Use increasing integers instead of unique strings for internal IDs #1426

Merged
merged 2 commits into from
Oct 11, 2024
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
28 changes: 17 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ An attribution source is a [=struct=] with the following items:

<dl dfn-for="attribution source">
: <dfn>internal ID</dfn>
:: A [=string=].
:: An [=internal ID=].
: <dfn>source origin</dfn>
:: A [=suitable origin=].
: <dfn>event ID</dfn>
Expand Down Expand Up @@ -1011,7 +1011,7 @@ An attribution report is a [=struct=] with the following items:
: <dfn>external ID</dfn>
:: A UUID formatted as a [=string=].
: <dfn>internal ID</dfn>
:: A [=string=].
:: An [=internal ID=].

</dl>

Expand Down Expand Up @@ -1125,9 +1125,9 @@ An <dfn>attribution rate-limit record</dfn> is a [=struct=] with the following i
: <dfn>expiry time</dfn>
:: Null or a [=moment=].
: <dfn>entity ID</dfn>
:: Null for [=obtain a fake report|fake reports=] or an [=event-level report=]'s [=event-level report/internal ID=] or an
[=aggregatable attribution report=]'s [=aggregatable attribution report/internal ID=] or an
[=attribution source=]'s [=attribution source/internal ID=].
:: Null for [=obtain a fake report|fake reports=] or an [=internal ID=] for an
[=event-level report=], [=aggregatable attribution report=], or
[=attribution source=].
: <dfn>deactivated for unexpired destination limit</dfn> (default false)
:: A [=boolean=].
: <dfn>destination limit priority</dfn> (default null)
Expand Down Expand Up @@ -1302,6 +1302,12 @@ shared among all [=environment settings objects=].
Note: This would ideally use <a spec=storage>storage bottles</a> to provide access to the attribution caches.
However attribution data is inherently cross-site, and operations on storage would need to span across all storage bottle maps.

An <dfn>internal ID</dfn> is an integer.

To <dfn>get the next internal ID</dfn>, return an [=internal ID=] strictly
linnan-github marked this conversation as resolved.
Show resolved Hide resolved
greater than any previously returned by this algorithm. The user agent MAY reset
this sequence when no [=attribution cache=] entry contains an [=internal ID=].

# Constants # {#constants}

<dfn>Valid source expiry range</dfn> is a 2-tuple of positive [=durations=] that controls the
Expand Down Expand Up @@ -2273,7 +2279,7 @@ an [=aggregation coordinator=] |aggregationCoordinator|, and a [=moment=] |now|:
: [=aggregatable debug report/external ID=]
:: The result of [=generating a random UUID=]
: [=aggregatable debug report/internal ID=]
:: A new unique [=string=]
:: The result of [=getting the next internal ID=]
: [=aggregatable debug report/contributions=]
:: |contributions|
: [=aggregatable debug report/aggregation coordinator=]
Expand Down Expand Up @@ -2804,7 +2810,7 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
1. Let |source| be a new [=attribution source=] struct whose items are:

: [=attribution source/internal ID=]
:: A new unique [=string=]
:: The result of [=getting the next internal ID=]
: [=attribution source/source origin=]
:: |sourceOrigin|
: [=attribution source/event ID=]
Expand Down Expand Up @@ -2961,7 +2967,7 @@ A <dfn>destination limit record</dfn> is a [=struct=] with the following items:
: <dfn>time</dfn>
:: A [=moment=]
: <dfn>source ID</dfn>
:: A [=string=].
:: An [=internal ID=].

</dl>

Expand Down Expand Up @@ -4400,7 +4406,7 @@ a 64-bit integer priority |priority|, and a [=trigger spec map=] [=map/entry=]
: [=event-level report/external ID=]
:: The result of [=generating a random UUID=].
: [=event-level report/internal ID=]
:: A new unique [=string=]
:: The result of [=getting the next internal ID=]
: [=event-level report/attribution debug info=]
:: (|source|'s [=attribution source/debug key=], |triggerDebugKey|).
1. Return |report|.
Expand Down Expand Up @@ -4430,7 +4436,7 @@ an [=attribution trigger=] |trigger|:
: [=aggregatable attribution report/external ID=]
:: The result of [=generating a random UUID=].
: [=aggregatable attribution report/internal ID=]
: A new unique [=string=]
:: The result of [=getting the next internal ID=]
: [=aggregatable attribution report/attribution debug info=]
:: (|source|'s [=attribution source/debug key=], |trigger|'s [=attribution trigger/debug key=]).
: [=aggregatable attribution report/contributions=]
Expand Down Expand Up @@ -4465,7 +4471,7 @@ To <dfn>obtain a null attribution report</dfn> given an [=attribution trigger=]
: [=aggregatable attribution report/external ID=]
:: The result of [=generating a random UUID=]
: [=aggregatable attribution report/internal ID=]
: A new unique [=string=]
:: The result of [=getting the next internal ID=]
: [=aggregatable attribution report/attribution debug info=]
:: (null, |trigger|'s [=attribution trigger/debug key=])
: [=aggregatable attribution report/contributions=]
Expand Down
Loading