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

Follow up of PR #23201 - Token refill is not happening in Later/Snoozing the captcha case #37790

Closed
GeetaSarvadnya opened this issue Apr 23, 2024 · 2 comments · Fixed by brave/brave-core#23240
Assignees
Labels

Comments

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Apr 23, 2024

Description

Follow up of PR brave/brave-core#23201 Token refill is not happening in Later/Snoozing the captcha case

Steps to Reproduce

  1. Clean profile 1.67.23 staging env
  2. Launch brave using brave.exe --enable-logging=stderr --vmodule="*/bat-native-ledger/*"=9,"*/brave_rewards/*"=9,"*/bat-native-ads/*"=9,"*/bat-native-confirmations/*"=9,"*/brave_ads/*"=9,"*/brave_user_model/*"=9 --rewards=staging=true,debug=true
  3. View an Ad
  4. Schedule a captcha
  5. Click on up and down arrow via ads history (when I click 30 times captcha arrived)
  6. Captcha notification appeard
  7. Click on Later on the notification
  8. Captcha notification dismissed
  9. Check the console logs
  10. I have seen No need to refill confirmation tokens as we already have 20 confirmation tokens which is above the minimum threshold
  11. Click on up and down arrow via ads history (I click 20 times to redeem 20 payment tokens)
  12. Try to trigger Ad
  13. Ads are not served, getting the following logs
[11056:21196:0423/192727.216:VERBOSE2:permission_rules.cc(110)] You do not have enough confirmation tokens
[11056:21196:0423/192727.216:VERBOSE1:notification_ad_serving.cc(77)] Notification ad not served: Not allowed due to permission rules
  1. Waited for more than 1 hours, there is no captcha notification to refill the payment tokens

Actual result:

Follow up of PR brave/brave-core#23201 Token refill is not happening in Later/Snoozing the captcha case

Expected result:

Token refill should happen via Captcha

Reproduces how often:

Easy

Brave version (brave://version info)

Brave | 1.67.32 Chromium: 124.0.6367.60 (Official Build) nightly (64-bit) -- | -- Revision | 8a7b8d1b13bc0b8b1c401b7e00f92f225e3e9231 OS | Windows 10 Version 22H2 (Build 19045.4291)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Not sure
  • Can you reproduce this issue with the beta channel? Not sure
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

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

Miscellaneous Information:

cc: @tmancey @emerick @brave/qa-team @rebron

@LaurenWags
Copy link
Member

Requires 1.65.124 or higher to test

@GeetaSarvadnya
Copy link
Author

GeetaSarvadnya commented Apr 29, 2024

Verification PASSED on

Brave | 1.65.124 Chromium: 124.0.6367.60 (Official Build) nightly (64-bit)
-- | --
Revision | 35add54e1426887f43e499a1a6054502c091c429
OS | Windows 10 Version 22H2 (Build 19045.4291)
  1. Clean profile 1.65.x staging environment
  2. Enabled rewards and viewed an Ad
  3. Scheduled a captcha
  4. Clicked on Up and Down arrow 30 times via Ads history
  5. Captcha notification is shown
Example Example
image image (1)
  1. Clicked on Later and noticed logs for processing confirmation tokens for all the 30 up and down arrow events, after that I have verified the [19016:4244:0428/115027.463:VERBOSE1:refill_confirmation_tokens.cc(70)] No need to refill confirmation tokens as we already have 20 confirmation tokens which is above the minimum threshold
  2. Clicked on up and down arrow 20 times and then I have noticed 20 confirmation payment token processed logs for 20 up and down arrow events. After that at certain point I have observed the logs for [19016:4244:0428/115638.712:VERBOSE1:confirmations.cc(127)] Confirmation queue is exhausted ,
  3. Try to trigger an Ad via Browser, then I have got logs as below:
[19016:4244:0428/121016.754:VERBOSE2:permission_rules.cc(110)] You do not have enough confirmation tokens
[19016:4244:0428/121016.754:VERBOSE1:notification_ad_serving.cc(77)] Notification ad not served: Not allowed due to permission rules

The logs above is expected as there are no unblinded payment tokens left over to trigger an Ad. After that I have waited 30 mins for the token refill request and I was getting logs as below:

 Response Status Code: 429
  Response: {"error":"Number of allowed tokens exceeded","statusCode":429}
 ...
[19016:4244:0428/120846.562:INFO:refill_confirmation_tokens.cc(128)] Failed to request signed tokens
[19016:4244:0428/120846.562:VERBOSE1:user_rewards.cc(122)] Failed to refill confirmation tokens
 
  1. Close the browser, saved the profile
  2. Waited for 24 hours
  3. Relaunched the browser via staging cmd line flag next day
  4. As soon as I launch the browser, I have got Captcha notification
Example Example Example
image image image
  1. Solve the captcha via captcha notification
  2. Confirmed that token refill request is initiated
  3. Confirmed that 50 payment token refill request is successful via console logs
[17912:17612:0429/125854.676:VERBOSE1:get_signed_tokens_url_request_util.cc(73)] Added 50 confirmation tokens, you now have 50 confirmation tokens
[17912:17612:0429/125854.677:VERBOSE1:user_rewards.cc(118)] Successfully refilled confirmation tokens
  1. Tried to trigger an Ad
  2. Confirmed that Ads are served

image

@GeetaSarvadnya GeetaSarvadnya added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Apr 29, 2024
@tmancey tmancey added this to Ads Jun 10, 2024
@tmancey tmancey moved this to Done in Ads Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
4 participants