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

Tokens fail to retry due to empty nonce #4146

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Tokens fail to retry due to empty nonce #4146

merged 1 commit into from
Dec 6, 2019

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Dec 5, 2019

Fixes brave/brave-browser#7222
Requires: #4106

Submitter Checklist:

Test Plan:

See brave/brave-browser#7222

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of comments that may turn out to be nothing.

@@ -53,12 +53,19 @@ void RefillTokens::Refill(

public_key_ = public_key;

nonce_ = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems unnecessary in the constructor, but fine by me if you'd just like to be explicit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need the nonce to reset if starting without the need to retry

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, I misread this as being the class's constructor. Sorry!

RequestSignedTokens();
}

void RefillTokens::RetryGettingSignedTokens() {
BLOG(INFO) << "Retry getting signed tokens";

if (nonce_.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any danger of endlessly retriggering this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is, however right now we have no retry count so I will raise a ticket

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tmancey
Copy link
Collaborator Author

tmancey commented Dec 6, 2019

CI failed with unrelated error (network audit)

@tmancey tmancey merged commit 1dbf7f6 into master Dec 6, 2019
@tmancey tmancey deleted the issues/7222 branch December 6, 2019 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tokens fail to retry due to empty nonce
2 participants