Skip to content

Commit

Permalink
Spec: Fix minor type issue in consume budget if permitted (#152)
Browse files Browse the repository at this point in the history
The algorithm takes a long when it should just take an integer (as the sum of many longs may not fit in a long).
  • Loading branch information
alexmturner authored Aug 1, 2024
1 parent b87549a commit 94f3f55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,12 @@ null |timeout|:
|currentWallTime|.
1. [=set/Append=] |report| to the user agent's [=aggregatable report cache=].

To <dfn algorithm>consume budget if permitted</dfn> given a {{long}} |value|, an
[=origin=] <var ignore=''>origin</var>, a [=context type=] |api| and a
To <dfn algorithm>consume budget if permitted</dfn> given an integer |value|,
an [=origin=] <var ignore=''>origin</var>, a [=context type=] |api| and a
[=moment=] |currentTime|, perform [=implementation-defined=] steps. They return
a [=boolean=], which indicates whether there is sufficient 'contribution budget'
left to send the requested contribution |value|. This budget should be bound to
left to send the requested contribution |value| (or multiple contributions with
a sum of values equal to |value|). This budget should be bound to
usage over time, e.g. the contribution sum over the last 24 hours. The algorithm
should assume that the contribution will be sent if and only if true is
returned, i.e. it should consume the budget in that case. If |value| is zero,
Expand Down

0 comments on commit 94f3f55

Please sign in to comment.