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

Estimated pending rewards for Ads resets to Zero in NTP after browser restart until ads has initialized #13267

Closed
GeetaSarvadnya opened this issue Dec 21, 2020 · 5 comments · Fixed by brave/brave-core#8208

Comments

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Dec 21, 2020

Description

Estimated pending rewards for Ads resets to Zero in NTP after browser restart until ads has initialized

Steps to Reproduce

  1. Clean profile 1.18.x or 1.20.x staging environmnet
  2. Enable rewards
  3. View an AD
  4. Ensured estimated pending rewards in AD's panel is displayed correctly
  5. Open an NTP by clicking on the + icon
  6. Ensured estimated pending rewards displayed correctly in the NTP
  7. Restart the browser
  8. Estimated pending rewards reset to zero in step 6
  9. Open 2nd NTP and verify the estimated pending rewards, value is displayed correctly

Note: Refresh/reload the NTP a couple of times fixes the issue

Actual result:

Estimated pending rewards for Ads resets to Zero in NTP after browser restart

Estimated pending rewards reset to zero

image

Expected result:

Estimated pending rewards for Ads should not reset to Zero in NTP after browser restart

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 1.20.40 Chromium: 88.0.4315.5 (Official Build) nightly (64-bit)
Revision d2abe4588adaeb0d66aa0a0106675be1dff12c64-refs/branch-heads/4315@{#11}
OS Windows 10 OS Version 2004 (Build 19041.685)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • 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: @brave/legacy_qa @tmancey @rebron

@tmancey
Copy link
Contributor

tmancey commented Dec 21, 2020

@GeetaSarvadnya Great catch. This is caused due to ads not being initialized when the widget is updated, the widget should cache the last value. @ryanml would you have time to take a look please? as we should (if we don't already) listen for the observer fired in AdsServiceImpl::OnAdRewardsChanged. Thanks

@tmancey tmancey self-assigned this Dec 21, 2020
@tmancey tmancey assigned ryanml and unassigned tmancey Dec 21, 2020
@tmancey tmancey changed the title Estimated pending rewards for Ads resets to Zero in NTP after browser restart Estimated pending rewards for Ads resets to Zero in NTP after browser restart until ads has initialized Dec 21, 2020
@tmancey tmancey self-assigned this Dec 22, 2020
@tmancey tmancey added the priority/P2 A bad problem. We might uplift this to the next planned release. label Dec 22, 2020
@tmancey tmancey added priority/P1 A very extremely bad problem. We might push a hotfix for it. and removed priority/P2 A bad problem. We might uplift this to the next planned release. labels Mar 10, 2021
@tmancey tmancey added this to the 1.23.x - Nightly milestone Mar 13, 2021
@stephendonner stephendonner added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Mar 15, 2021
@stephendonner
Copy link

Verified PASSED using nightly with the inline testplan here, and build

Brave 1.23.39 Chromium: 89.0.4389.90 (Official Build) nightly (x86_64)
Revision 62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389@{#1534}
OS macOS Version 11.2.3 (Build 20D91)

Steps from @GeetaSarvadnya (please double-check!)

  1. Clean profile on 1.23.39
  2. Enabled Rewards
  3. View an ad
  4. Ensured Estimated pending rewards amount in ads panel was displayed correctly (0.010 BAT)
  5. Opened a NTP by clicking on the + icon
  6. Ensured the Estimated pending rewards amount still displayed correctly in the NTP (0.010 BAT)
  7. Restarted the browser
  8. Verified the correct Estimated pending rewards amount still displayed correctly in the NTP widget and in the Rewards panel (0.010 BAT)
  9. Opened 2nd NTP and verified the same Estimated pending rewards value was displayed correctly (0.010)

Screencast (too large for GitHub): https://drive.google.com/file/d/1F2Mm_FPCGErnQeJAM-tzTfEH5LH5pvrd/view?usp=sharing

@stephendonner stephendonner added QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Mar 15, 2021
@kjozwiak
Copy link
Member

kjozwiak commented Mar 16, 2021

@stephendonner can you do a quick sanity check to make sure this made it into 1.22.x after being merged via brave/brave-core#8245 (review). There's no need to recheck/retest everything. We just need to make sure that 1.22.x has the fix as we QA'd this on Nightly.

@stephendonner
Copy link

@kjozwiak yup, will test first thing tomorrow

@stephendonner
Copy link

@kjozwiak just re-tested with

Brave 1.22.64 Chromium: 89.0.4389.90 (Official Build) (x86_64)
Revision 62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389@{#1534}
OS macOS Version 11.2.3 (Build 20D91)

Verified all the steps and endpoints (Rewards, new-tab page widget) have 0.010 BAT listed, before & after restart 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment