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

Clean up fake report generation #1135

Merged
merged 4 commits into from
Jan 4, 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
48 changes: 11 additions & 37 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2188,37 +2188,9 @@ a [=trigger state=] |triggerState|:
:: «[ "`source_type`" → « |source|'s [=attribution source/source type=] » ]»
1. Let |triggerTime| be the greatest [=moment=] that is strictly less than
|triggerState|'s [=trigger state/report window=]'s [=report window/end=].
1. Let |fakeTrigger| be a new [=attribution trigger=] with the items:
: [=attribution trigger/attribution destinations=]
:: |source|'s [=attribution source/attribution destinations=]
: [=attribution trigger/trigger time=]
:: |triggerTime|
: [=attribution trigger/reporting origin=]
:: |source|'s [=attribution source/reporting origin=]
: [=attribution trigger/filters=]
:: «[]»
: [=attribution trigger/debug key=]
:: null
: [=attribution trigger/event-level trigger configurations=]
:: « |fakeConfig| »
: [=attribution trigger/aggregatable trigger data=]
:: «»
: [=attribution trigger/aggregatable values=]
:: «[]»
: [=attribution trigger/aggregatable dedup key=]
:: «»
: [=attribution trigger/debug reporting enabled=]
:: false
: [=attribution trigger/aggregation coordinator=]
:: [=default aggregation coordinator=]
: [=attribution trigger/verifications=]
:: «»
: [=attribution trigger/aggregatable source registration time configuration=]
:: "<code>[=aggregatable source registration time configuration/exclude=]</code>"
: [=attribution trigger/trigger context ID=]
:: null
1. Let |fakeReport| be the result of running [=obtain an event-level report=] with |source|,
|fakeTrigger|, and |fakeConfig|.
|triggerTime|, [=obtain an event-level report/triggerDebugKey=] set to null,
|fakeConfig|, and |triggerState|'s [=trigger state/trigger data=].
1. [=Assert=]: |fakeReport|'s [=event-level report/report time=] is equal to
|triggerState|'s [=trigger state/report window=]'s [=report window/end=].
1. Return |fakeReport|.
Expand Down Expand Up @@ -2900,7 +2872,8 @@ To <dfn>trigger event-level attribution</dfn> given an [=attribution trigger=] |
1. If the result of running [=should attribution be blocked by rate limits=]
with |trigger|, |sourceToAttribute|, and |rateLimitRecord| is not null,
return it.
1. Let |report| be the result of running [=obtain an event-level report=] with |sourceToAttribute|, |trigger|,
1. Let |report| be the result of running [=obtain an event-level report=] with |sourceToAttribute|,
|trigger|'s [=attribution trigger/trigger time=], |trigger|'s [=attribution trigger/debug key=],
|matchedConfig|, and |triggerData|.
1. If |sourceToAttribute|'s [=attribution source/event-level attributable=] value
is false:
Expand Down Expand Up @@ -3147,11 +3120,12 @@ To <dfn>obtain an aggregatable report delivery time</dfn> given an [=attribution

<h3 algorithm id="obtaining-an-event-level-report">Obtaining an event-level report</h3>

To <dfn>obtain an event-level report</dfn> given an [=attribution source=] |source|, an [=attribution trigger=]
|trigger|, an [=event-level trigger configuration=] |config|, and a non-negative
64-bit integer |triggerData|:
To <dfn>obtain an event-level report</dfn> given an [=attribution source=] |source|,
a [=moment=] |triggerTime|, an optional non-negative 64-bit integer
<dfn for="obtain an event-level report"><var>triggerDebugKey</var></dfn>,
an [=event-level trigger configuration=] |config|, and a non-negative 64-bit integer |triggerData|:

1. Let |reportTime| be the result of running [=obtain an event-level report delivery time=] with |source| and |trigger|'s [=attribution trigger/trigger time=].
1. Let |reportTime| be the result of running [=obtain an event-level report delivery time=] with |source| and |triggerTime|.
1. Let |report| be a new [=event-level report=] struct whose items are:

: [=event-level report/event ID=]
Expand All @@ -3169,15 +3143,15 @@ To <dfn>obtain an event-level report</dfn> given an [=attribution source=] |sour
: [=event-level report/trigger priority=]
:: |config|'s [=event-level trigger configuration/priority=].
: [=event-level report/trigger time=]
:: |trigger|'s [=attribution trigger/trigger time=].
:: |triggerTime|.
: [=event-level report/source identifier=]
:: |source|'s [=attribution source/source identifier=].
: [=event-level report/report id=]
:: The result of [=generating a random UUID=].
: [=event-level report/source debug key=]
:: |source|'s [=attribution source/debug key=].
: [=event-level report/trigger debug key=]
:: |trigger|'s [=attribution trigger/debug key=].
:: |triggerDebugKey|.
1. Return |report|.

<h3 id="obtaining-required-aggregatable-budget">Obtaining an aggregatable report's required budget</h3>
Expand Down