diff --git a/index.bs b/index.bs
index 49095a3ef2..7ddd42ae11 100644
--- a/index.bs
+++ b/index.bs
@@ -562,13 +562,11 @@ To clear site data given an [=origin=] |origin|:
1. [=set/iterate|For each=] [=attribution source=] |source| of the [=attribution source cache=]:
1. If |source|'s [=attribution source/reporting origin=] and |origin| are [=same origin=],
- [=set/remove=] |source| from the [=attribution source cache=].
-1. [=set/iterate|For each=] [=event-level report=] |report| of the [=event-level report cache=]:
- 1. If |report|'s [=event-level report/reporting origin=] and |origin| are [=same origin=],
- [=set/remove=] |report| from the [=event-level report cache=].
-1. [=set/iterate|For each=] [=aggregatable attribution report=] |report| of the [=aggregatable attribution report cache=]:
- 1. If |report|'s [=aggregatable attribution report/reporting origin=] and |origin| are [=same origin=],
- [=set/remove=] |report| from the [=aggregatable attribution report cache=].
+ [=remove an attribution source|remove=] |source| with
+ [=remove an attribution source/flushPendingEventLevelReports=] set to false.
+1. [=set/iterate|For each=] [=attribution report=] |report| of the [=report cache=]:
+ 1. If |report|'s [=attribution report/reporting origin=] and |origin| are [=same origin=],
+ [=set/remove=] |report| from the [=report cache=].
Note: We deliberately do *not* remove matching entries from the
[=attribution rate-limit cache=] and [=aggregatable debug rate-limit cache=], as doing so would allow a site to reset and
@@ -802,6 +800,8 @@ An attribution source is a [=struct=] with the following items:
:: A 64-bit integer.
: source time
:: A [=moment=].
+: pending event-level reports
+:: A [=list=] of [=event-level reports=] attributed to this [=attribution source=] that haven't yet been sent.
: number of event-level reports
:: Number of [=event-level reports=] created for this [=attribution source=].
: max number of event-level reports
@@ -1303,9 +1303,7 @@ A destination rate-limit result is one of the following:
A user agent holds an attribution source cache, which is a [=set=] of [=attribution sources=].
-A user agent holds an event-level report cache, which is a [=set=] of [=event-level reports=].
-
-A user agent holds an aggregatable attribution report cache, which is a [=set=] of [=aggregatable attribution reports=].
+A user agent holds a report cache, which is a [=set=] of [=attribution reports=] to be sent.
A user agent holds an attribution rate-limit cache, which is a [=set=] of [=attribution rate-limit records=].
@@ -1440,12 +1438,10 @@ is "[=aggregatable source registration time configuration/include=]
this is 0.
Max event-level reports per attribution destination is a positive integer that
-controls how many [=event-level reports=] can be in the
-[=event-level report cache=] per [=site=] in
-[=event-level report/attribution destinations=].
+controls how many [=event-level reports=] can be pending at once per attribution destination.
Max aggregatable attribution reports per attribution destination is a positive integer that controls how
-many [=aggregatable attribution reports=] can be in the [=aggregatable attribution report cache=] per
+many [=aggregatable attribution reports=] can be in the [=report cache=] per
[=aggregatable attribution report/effective attribution destination=].
Max event-level channel capacity per source is a [=map=] that
@@ -2828,6 +2824,16 @@ Issue: Determine proper charset-handling for the JSON header value.
[=event-level-report-replacement result/add-new-report=]
".
-1. Let |matchingReports| be a new [=list=] whose elements are all the elements in the [=event-level report cache=] whose [=event-level report/report time=] and [=event-level report/source identifier=] are equal to |report|'s, [=list/sorted in ascending order=] using [=event-level report/is lower-priority than=].
+1. Let |matchingReports| be a new [=list=] whose elements are all the elements in |sourceToAttribute|'s [=attribution source/pending event-level reports=] whose [=event-level report/report time=] is equal to |report|'s, [=list/sorted in ascending order=] using [=event-level report/is lower-priority than=].
1. If |matchingReports| [=list/is empty=]:
1. Set |sourceToAttribute|'s [=attribution source/event-level attributable=] value to false.
1. Return "[=event-level-report-replacement result/drop-new-report-none-to-replace=]
".
@@ -3870,7 +3882,7 @@ To maybe replace event-level report given an [=attribution source=]
1. Let |lowestPriorityReport| be |matchingReports|[0].
1. If |report| [=event-level report/is lower-priority than=] |lowestPriorityReport|,
return "[=event-level-report-replacement result/drop-new-report-low-priority=]
".
-1. [=set/Remove=] |lowestPriorityReport| from the [=event-level report cache=].
+1. [=set/Remove=] |lowestPriorityReport| from |sourceToAttribute|'s [=attribution source/pending event-level reports=].
1. Decrement |sourceToAttribute|'s [=attribution source/number of event-level reports=] value by 1.
1. Let |rateLimitRecord| be the element from [=attribution rate-limit cache=] whose
[=attribution rate-limit record/entity ID=] is equal to |lowestPriorityReport|'s [=event-level report/report ID=]
@@ -3960,8 +3972,11 @@ To trigger event-level attribution given an [=attribution trigger=] |
[=event-level-report-replacement result/add-new-report=]
"
::
- 1. Let |numMatchingReports| be the number of entries in the [=event-level report cache=] whose
- [=event-level report/attribution destinations=] [=set/contains=] |trigger|'s [=attribution trigger/attribution destination=].
+ 1. Let |numMatchingReports| be 0.
+ 1. [=set/iterate|For each=] |source| in the [=attribution source cache=]:
+ 1. [=list/iterate|For each=] |report| in |source|'s [=attribution source/pending event-level reports=]:
+ 1. If |report|'s [=event-level report/attribution destinations=] [=set/contains=] |trigger|'s [=attribution trigger/attribution destination=],
+ increment |numMatchingReports| by 1.
1. If |numMatchingReports| is greater than or equal to the user agent's [=max event-level reports per attribution destination=]:
1. Return the [=triggering result=] ("[=triggering status/dropped=]
",
("[=trigger debug data type/trigger-event-storage-limit=]
", null)).
@@ -3981,7 +3996,7 @@ To trigger event-level attribution given an [=attribution trigger=] |
[=triggering status/dropped=]
",
("[=trigger debug data type/trigger-aggregate-no-contributions=]
", null)).
-1. Let |numMatchingReports| be the number of entries in the [=aggregatable attribution report cache=] whose
+1. Let |numMatchingReports| be the number of entries in the [=report cache=] that are
+ [=aggregatable attribution reports=] whose
[=aggregatable attribution report/effective attribution destination=] equals |trigger|'s [=attribution trigger/attribution destination=]
and [=aggregatable attribution report/is null report=] is false.
1. If |numMatchingReports| is greater than or equal to the user agent's
@@ -4059,7 +4075,7 @@ To trigger aggregatable attribution given an [=attribution trigger=]
with |report| and |sourceToAttribute| is false:
1. Return the [=triggering result=] ("[=triggering status/dropped=]
",
("[=trigger debug data type/trigger-aggregate-insufficient-budget=]
", null)).
-1. [=set/Append=] |report| to the [=aggregatable attribution report cache=].
+1. [=set/Append=] |report| to the [=report cache=].
1. Increment |sourceToAttribute|'s [=attribution source/number of aggregatable attribution reports=] value by 1.
1. Decrement |sourceToAttribute|'s [=attribution source/remaining aggregatable attribution budget=] value by
|report|'s [=aggregatable attribution report/required aggregatable budget=].
@@ -4181,7 +4197,8 @@ To trigger attribution given an [=attribution trigger=] |tri
1. Return.
1. [=list/Remove=] |sourceToAttribute| from |matchingSources|.
1. [=list/iterate|For each=] |item| of |matchingSources|:
- 1. [=set/Remove=] |item| from the [=attribution source cache=].
+ 1. [=remove an attribution source|Remove=] |item| with
+ [=remove an attribution source/flushPendingEventLevelReports=] set to true.
1. Let |eventLevelResult| be the result of running [=trigger event-level attribution=]
with |trigger| and |sourceToAttribute|.
1. Let |aggregatableResult| be the result of running [=trigger aggregatable attribution=]
@@ -4367,7 +4384,7 @@ To generate null attribution reports given an [=attribution trigger=]
|randomizedNullReportRate| is true:
1. Let |nullReport| be the result of [=obtaining a null attribution report=] with |trigger| and |trigger|'s
[=attribution trigger/trigger time=].
- 1. [=set/Append=] |nullReport| to the [=aggregatable attribution report cache=].
+ 1. [=set/Append=] |nullReport| to the [=report cache=].
1. [=list/Append=] |nullReport| to |nullReports|.
1. Otherwise:
1. [=Assert=]: |trigger|'s [=attribution trigger/trigger context ID=] is null.
@@ -4382,7 +4399,7 @@ To generate null attribution reports given an [=attribution trigger=]
1. [=iteration/Continue=].
1. If the result of [=determining if a randomized null attribution report is generated=] with [=randomized null attribution report rate including source registration time=] is true:
1. Let |nullReport| be the result of [=obtaining a null attribution report=] with |trigger| and |fakeSourceTime|.
- 1. [=set/Append=] |nullReport| to the [=aggregatable attribution report cache=].
+ 1. [=set/Append=] |nullReport| to the [=report cache=].
1. [=list/Append=] |nullReport| to |nullReports|.
1. Return |nullReports|.
@@ -4427,21 +4444,26 @@ Issue: Specify this in terms of