brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.51k stars 2.26k forks source link

Follow up to #20131: Unblinded tokens refill is not scheduled after captcha is solved #31182

Closed btlechowski closed 1 year ago

btlechowski commented 1 year ago

Follow up to #20131

User may not be paid for viewing ads even after solving the captcha. User needs to restart the browser to trigger unblinded tokens refill

Steps to Reproduce

  1. Clean profile
  2. Run Brave
  3. Enable Rewards and Ads
  4. Schedule a captcha for your payment ID
  5. Trigger unblinded tokens refill
  6. Solve captcha

Actual result:

unblinded tokens refill is not scheduled after captcha is solved

Note: unblinded tokens refill is triggered after browser restart

Expected result:

unblinded tokens refill is scheduled after captcha is solved

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Brave 1.53.99 Chromium: 114.0.5735.133 (Official Build) beta (64-bit)
Revision fbfa2ce68d01b2201d8c667c2e73f648a61c4f4a-refs/branch-heads/5735@{#1270}
OS Ubuntu 18.04 LTS

cc @tmancey @aseren

btlechowski commented 1 year ago

Verification PASSED

Brave 1.58.97 Chromium: 116.0.5845.96 (Official Build) beta (64-bit)
Revision c983323d5ff7738a3c8d3bf491a7241c24b4d65a
OS Linux

Verified test plan from the description

Verified the captcha was scheduled: image

Verified captcha was solved successfully image

Verified unblinded token refill is scheduled:

[8053:8053:0905/181659.281456:VERBOSE1:refill_unblinded_tokens.cc(168)] GetSignedTokens
[8053:8053:0905/181659.281585:VERBOSE2:refill_unblinded_tokens.cc(169)] GET /v3/confirmation/token/{paymentId}?nonce={nonce}
[8053:8053:0905/181659.281658:VERBOSE6:refill_unblinded_tokens.cc(173)] URL Request:

Verified unblinded tokens are refilled

[8053:8053:0905/181706.854667:VERBOSE1:refill_unblinded_tokens.cc(334)] Added 32 unblinded tokens, you now have 50 unblinded tokens
[8053:8053:0905/181706.855764:VERBOSE1:refill_unblinded_tokens.cc(340)] Successfully refilled unblinded tokens