Skip to content

Align impression-site-quota deduction in simulator with spec - #459

Merged
apasel422 merged 1 commit into
w3c:mainfrom
apasel422:spec-match
Jul 22, 2026
Merged

Align impression-site-quota deduction in simulator with spec#459
apasel422 merged 1 commit into
w3c:mainfrom
apasel422:spec-match

Conversation

@apasel422

@apasel422 apasel422 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This is just a minor code reorganization in the simulator corresponding to

attribution/api.bs

Lines 1264 to 1284 in c3e21e1

1. [=list/iterate|For each=] |impression| in |impressions|:
1. Let |impressionSite| be |impression|'s [=impression/impression site=].
1. Let |impressionQuotaKey| be an [=privacy budget key=]
whose items are |epoch| and |impressionSite|.
<p class=note>The below ensures that we do not deduct budget
more than once from the same impression site quota
when there are multiple impressions for the site.
1. If |deductedImpressionQuotas| does not [=map/contain=] |impressionQuotaKey|:
1. [=set/Append=] |deductedImpressionQuotas| with |impressionQuotaKey|.
1. Let |currentImpressionQuotaValue| be the result of [=map/get|getting the value=] of |impressionQuotaKey|
in the [=impression site quota per epoch=]
with a default of the [=impression site quota per epoch=].
1. [=map/set|Set=] the value of [=impression site quota per epoch=]\[|impressionQuotaKey|\]
to |currentImpressionQuotaValue| − |valueDeduction|.
.

@apasel422
apasel422 marked this pull request as ready for review July 8, 2026 13:16
@apasel422
apasel422 requested review from bmcase and martinthomson July 8, 2026 13:17
@apasel422
apasel422 merged commit dafb094 into w3c:main Jul 22, 2026
2 checks passed
@apasel422
apasel422 deleted the spec-match branch July 22, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants