From 31e5c7eef58457843c977ad8b3c01ba8f2dfa6da Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Wed, 11 Sep 2024 10:44:19 -0400 Subject: [PATCH] Use increasing integers instead of unique strings for internal IDs This will make it easier to address #1405, but is beneficial in itself because it indicates the scope of the uniqueness that was previously implicit for strings. --- index.bs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/index.bs b/index.bs index d47273083d..a205c218d4 100644 --- a/index.bs +++ b/index.bs @@ -790,7 +790,7 @@ An attribution source is a [=struct=] with the following items:
: internal ID -:: A [=string=]. +:: An [=internal ID=]. : source origin :: A [=suitable origin=]. : event ID @@ -1011,7 +1011,7 @@ An attribution report is a [=struct=] with the following items: : external ID :: A UUID formatted as a [=string=]. : internal ID -:: A [=string=]. +:: An [=internal ID=].
@@ -1302,6 +1302,12 @@ shared among all [=environment settings objects=]. Note: This would ideally use storage bottles 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 internal ID is an integer. + +To get the next internal ID, return an [=internal ID=] strictly +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} Valid source expiry range is a 2-tuple of positive [=durations=] that controls the @@ -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=] @@ -2804,7 +2810,7 @@ To parse source-registration JSON 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=] @@ -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|. @@ -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=] @@ -4465,7 +4471,7 @@ To obtain a null attribution report 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=]