@@ -651,13 +651,27 @@ null |timeout|:
651
651
agents=] to drop reports for a number of reasons, for example user
652
652
opt-out or an origin not being
653
653
<a href="https://github.com/privacysandbox/attestation">enrolled</a> .
654
+ 1. Let |mergedContributions| be a new [=list=] .
655
+ 1. [=list/For each=] |contribution| of |contributions|:
656
+ 1. Let |hasProcessedContribution| be false.
657
+ 1. [=list/For each=] |mergedContribution| of |mergedContributions|:
658
+ 1. If |contribution| and |mergedContribution| have both the same
659
+ {{PAHistogramContribution/bucket}} and the same
660
+ {{PAHistogramContribution/filteringId}} :
661
+ 1. Add |contribution|'s {{PAHistogramContribution/value}} to
662
+ |mergedContribution|'s {{PAHistogramContribution/value}} .
663
+ 1. Set |hasProcessedContribution| to true.
664
+ 1. [=iteration/Break=] .
665
+ 1. If |hasProcessedContribution| is false, [=list/append=] |contribution| to
666
+ |mergedContributions|.
654
667
1. Let |truncatedContributions| be a new [=list=] .
655
- 1. If |contributions | has a [=list/size=] greater than [=maximum report
668
+ 1. If |mergedContributions | has a [=list/size=] greater than [=maximum report
656
669
contributions=] :
657
670
1. [=set/For each=] |n| of [=the exclusive range|the range=] 0 to [=maximum
658
671
report contributions=] , exclusive:
659
- 1. [=set/Append=] |contributions|[|n|] to |truncatedContributions|.
660
- 1. Otherwise, set |truncatedContributions| to |contributions|.
672
+ 1. [=set/Append=] |mergedContributions|[|n|] to
673
+ |truncatedContributions|.
674
+ 1. Otherwise, set |truncatedContributions| to |mergedContributions|.
661
675
1. Let |contributionSum| be 0.
662
676
1. [=set/iterate|For each=] |contribution| of |truncatedContributions|:
663
677
1. [=Assert=] : |contribution|["{{PAHistogramContribution/value}}"] is
@@ -667,6 +681,11 @@ null |timeout|:
667
681
1. Let |currentWallTime| be the [=current wall time=] .
668
682
1. Let |sufficientBudget| be the result of [=consuming budget if permitted=]
669
683
given |contributionSum|, |reportingOrigin|, |api| and |currentWallTime|.
684
+
685
+ Issue: Allow for some of the contributions to still be approved even if
686
+ there isn't enough budget for the entire report. Note that this change
687
+ would require the merging step to be postponed until after budgeting and
688
+ the truncation step modified to account for the later merging.
670
689
1. If |sufficientBudget| is false:
671
690
1. Let |isDeterministicReport| be the result of [=determining if a report
672
691
should be sent deterministically=] given |preSpecifiedParams|.
0 commit comments