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

[Desktop]Follow up of #10064 - Rewards is turned off instead of reset when page is reloaded #10934

Closed
GeetaSarvadnya opened this issue Jul 27, 2020 · 4 comments · Fixed by brave/brave-core#6274

Comments

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jul 27, 2020

Description

Follow up of #10064 - Rewards is turned off instead of getting reset. Reloading the rewards page causes it to change to off state

Steps to Reproduce

  1. Clean profile 1.12.x
  2. Enable rewards
  3. Click on settings icon in brave://rewards page and click on Reset option
  4. Click on Reset and ensure rewards reset notification is shown
  5. Rewards is still enabled after doing a reset
  6. Reload brave://rewards page
  7. Brave rewards is turned off instead of being reset

Actual result:

Rewards is turned off when reloading the page after trying to reset rewards

After resetting rewards:
image

Page refresh after resetting rewards:
image

Expected result:

Rewards should be reset in brave://rewards page without page refresh

Reproduces how often:

Always

Brave version (brave://version info)

Brave 1.12.101 Chromium: 84.0.4147.89 (Official Build) dev (64-bit)
Revision 19abfe7bcba9318a0b2a6bc6634a67fc834aa592-refs/branch-heads/4147@{#852}
OS Windows 10 OS Version 1903 (Build 18362.959)

Version/Channel Information:

  • Can you reproduce this issue with the current release? NA
  • 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 @rebron @NejcZdovc

@srirambv srirambv changed the title [Desktop]Follow up of #10064 - Rewards is not reset in brave://rewards settings page until page is refreshed [Desktop]Follow up of #10064 - Rewards is turned off when reloading the page after trying to reset rewards Jul 28, 2020
@srirambv srirambv changed the title [Desktop]Follow up of #10064 - Rewards is turned off when reloading the page after trying to reset rewards [Desktop]Follow up of #10064 - Rewards is turned off instead of reset when page is reloaded Jul 28, 2020
@srirambv
Copy link
Contributor

This is what is happening on all OS

Linux/MacOS - Go to rewards menu -> Reset -> Click Reset -> Popup modal ask for confirmation -> Rewards goes into pre-opt in page (yes i'm button)

Windows - Go to rewards menu -> Reset -> Click reset -> popup modal asks for confirmation -> nothing happens -> reload the page -> rewards is turned off not reset

Once reset on windows is fixed issues #10937, #10939, #10935, #10940, #10941, #10943 will all become obsolete/invalid

@emerick
Copy link
Contributor

emerick commented Jul 29, 2020

The issue here is that you can't delete an open file on Windows, but reset is trying to delete both the log file and the database file without closing them first. Closing those files during reset seemed to trigger a lot of errors as most of our code doesn't seem to expect that situation. @NejcZdovc Should I go through and make the code handle that situation or is there a better solution here?

@NejcZdovc
Copy link
Contributor

@emerick that would be great if we can handle this situation with the current approach.

@GeetaSarvadnya
Copy link
Author

GeetaSarvadnya commented Aug 5, 2020

Verification passed on


Brave | 1.12.107 Chromium: 84.0.4147.105 (Official Build) (64-bit)
-- | --
Revision | a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS | Windows 10 OS Version 1903 (Build 18362.959)

  • Verified the test plan from Fix Rewards reset failing on Windows brave-core#6274 and STR from the issue
  • Ensured Rewards reset is working fine and after reset, rewards welcome page is displayed
    image
  • Verified that ads_service, rewards_service publisher_info_db and Rewards.log folders/files are removed from the profile folder
  • Verified that brave_rewards and brave_ads sections are removed from Preference file
  • Verified that rewards can be opt-in from brave://settings, BR panel and NTP widget and all the options are working as expeted

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