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

Spec: Fix minor type issue in consume budget if permitted #152

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

alexmturner
Copy link
Collaborator

@alexmturner alexmturner commented Jul 31, 2024

The algorithm takes a long when it should just take an integer (as the sum of many longs may not fit in a long).


Preview | Diff

The algorithm takes a long when it should just take an integer (as the sum of many longs may not fit in a long).
@alexmturner
Copy link
Collaborator Author

@dmcardle, could you PTAL? Thanks!

@@ -697,8 +697,8 @@ 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|,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also specify that it's the sum of contribution values?

I also just realized that we never actually "call" this algorithm anywhere. Is that intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the wording slightly, lmk if that's clearer. And we do call it here :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I couldn't find the reference because I was searching for [=consume in spec.bs and found nothing. Instead, we're calling "consuming budget if permitted" here. Despite not being a literal string match, bikeshed correctly links to the definition, so maybe it's doing some fuzzy matching?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, bikeshed is very cool! It'll match like this for the first or last word in the name (see here). For future reference, you can click on the definition in the rendered file and it shows all of the references.

Copy link
Contributor

@dmcardle dmcardle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -697,8 +697,8 @@ 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|,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I couldn't find the reference because I was searching for [=consume in spec.bs and found nothing. Instead, we're calling "consuming budget if permitted" here. Despite not being a literal string match, bikeshed correctly links to the definition, so maybe it's doing some fuzzy matching?

@alexmturner
Copy link
Collaborator Author

Thanks for the review!

@alexmturner alexmturner merged commit 94f3f55 into main Aug 1, 2024
1 check passed
@alexmturner alexmturner deleted the alexmturner-long-spec-fix branch August 1, 2024 18:53
github-actions bot added a commit that referenced this pull request Aug 1, 2024
SHA: 94f3f55
Reason: push, by alexmturner

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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