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

browser doesn't retry to get signed tokens in all cases #6647

Closed
LaurenWags opened this issue Oct 29, 2019 · 4 comments · Fixed by brave/brave-core#4106
Closed

browser doesn't retry to get signed tokens in all cases #6647

LaurenWags opened this issue Oct 29, 2019 · 4 comments · Fixed by brave/brave-core#4106
Assignees
Labels
bug feature/ads priority/P3 The next thing for us to work on. It'll ride the trains. QA/No QA Pass-macOS release-notes/include

Comments

@LaurenWags
Copy link
Member

Description

While testing I got a Tokens don't exist response from the server on several profiles. When this occurred, the browser did not retry to get signed tokens again. Because of this, I was not served Ads.

Steps to Reproduce

  1. Launch clean profile with --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
  2. Enable Rewards
  3. Watch terminal

Actual result:

Rarely, you might encounter below message. Afterwards, the browser does not retry to get signed tokens, so Ads are not served to the user.

[16257:775:1029/100754.876923:INFO:refill_tokens.cc(155)] GetSignedTokens
[16257:775:1029/100754.876933:INFO:refill_tokens.cc(157)] GET /v1/confirmation/token/{payment_id}?nonce={nonce}
[16257:775:1029/100754.876943:INFO:refill_tokens.cc(160)] URL Request:
[16257:775:1029/100754.876955:INFO:refill_tokens.cc(163)]   URL: https://ads-serve.brave.com/v1/confirmation/token/13f3291d-ab07-470b-87b3-9d1d7a1db5a5?nonce=b4ac7b58-f0b8-4074-8a7c-b4c7a7c309d5
[16257:775:1029/100755.041816:INFO:refill_tokens.cc(178)] OnGetSignedTokens
[16257:775:1029/100755.041855:INFO:refill_tokens.cc(180)] URL Request Response:
[16257:775:1029/100755.041867:INFO:refill_tokens.cc(181)]   URL: https://ads-serve.brave.com/v1/confirmation/token/13f3291d-ab07-470b-87b3-9d1d7a1db5a5?nonce=b4ac7b58-f0b8-4074-8a7c-b4c7a7c309d5
[16257:775:1029/100755.041879:INFO:refill_tokens.cc(182)]   Response Status Code: 404
[16257:775:1029/100755.041890:INFO:refill_tokens.cc(183)]   Response: {"error":"Tokens don't exist","statusCode":404}
[16257:775:1029/100755.041901:INFO:refill_tokens.cc(184)]   Headers:
[16257:775:1029/100755.041911:INFO:refill_tokens.cc(186)]     accept-ranges: bytes
[16257:775:1029/100755.041921:INFO:refill_tokens.cc(186)]     access-control-allow-origin: *
[16257:775:1029/100755.041931:INFO:refill_tokens.cc(186)]     connection: keep-alive
[16257:775:1029/100755.041941:INFO:refill_tokens.cc(186)]     content-length: 47
[16257:775:1029/100755.041951:INFO:refill_tokens.cc(186)]     content-type: application/json; charset=utf-8
[16257:775:1029/100755.041962:INFO:refill_tokens.cc(186)]     date: Tue, 29 Oct 2019 14:07:55 GMT
[16257:775:1029/100755.041973:INFO:refill_tokens.cc(186)]     etag: W/"2f-vMmf6VLkjFm9SHdT7UNWnWn7nSs"
[16257:775:1029/100755.041983:INFO:refill_tokens.cc(186)]     via: 1.1 varnish
[16257:775:1029/100755.041994:INFO:refill_tokens.cc(186)]     x-cache: MISS
[16257:775:1029/100755.042004:INFO:refill_tokens.cc(186)]     x-cache-hits: 0
[16257:775:1029/100755.042014:INFO:refill_tokens.cc(186)]     x-powered-by: Express
[16257:775:1029/100755.042024:INFO:refill_tokens.cc(186)]     x-served-by: cache-ewr18132-EWR
[16257:775:1029/100755.042034:ERROR:refill_tokens.cc(190)] Failed to get signed tokens

If you keep watching, there are no retry attempts.

Expected result:

When error above is encountered (as it is a legitimate error), the browser should retry to get signed tokens.

Reproduces how often:

Getting the [16257:775:1029/100755.041890:INFO:refill_tokens.cc(183)] Response: {"error":"Tokens don't exist","statusCode":404} is rare, but once you get the message, it is easy to see that the browser does not retry.

Brave version (brave://version info)

encountered with

Brave 0.72.111 Chromium: 78.0.3904.70 (Official Build) dev (64-bit)
Revision edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS macOS Version 10.13.6 (Build 17G5019)

Version/Channel Information:

  • Can you reproduce this issue with the current release? unsure
  • Can you reproduce this issue with the beta channel? unsure
  • Can you reproduce this issue with the dev channel? encountered here
  • Can you reproduce this issue with the nightly channel? unsure

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? n/a
  • Does the issue resolve itself when disabling Brave Rewards? n/a
  • Is the issue reproducible on the latest version of Chrome? n/a

Miscellaneous Information:

cc @tmancey @jsecretan @brave/legacy_qa

@btlechowski
Copy link

QA/Blocked on #7666

@kjozwiak
Copy link
Member

Waiting on @tmancey to add some info re: reproducing the 400 issue with Charles Proxy and ensuring that the retry works as expected.

@kjozwiak
Copy link
Member

kjozwiak commented Feb 4, 2020

Due to this being hard to QA and which takes up a lot of time, we're going to check a single platform to make sure it's working after speaking with both @tmancey and @jsecretan.

@kjozwiak kjozwiak removed the QA/Yes label Feb 5, 2020
@kjozwiak kjozwiak added the QA/No label Feb 5, 2020
@kjozwiak
Copy link
Member

kjozwiak commented Feb 5, 2020

Verification PASSED on macOS 10.15.3 x64 using the following build:

Brave 1.3.110 Chromium: 80.0.3987.78 (Official Build) (64-bit)
Revision cb5aa81cb0a3a2c674b93bc7ffb34a86cd3b4802-refs/branch-heads/3987@{#752}
OS macOS Version 10.15.3 (Build 19D76)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/ads priority/P3 The next thing for us to work on. It'll ride the trains. QA/No QA Pass-macOS release-notes/include
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants