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

brave://settings/rewards incorrectly says Brave Rewards are disabled #22003

Closed
Miyayes opened this issue Mar 31, 2022 · 8 comments · Fixed by brave/brave-core#12877
Closed

brave://settings/rewards incorrectly says Brave Rewards are disabled #22003

Miyayes opened this issue Mar 31, 2022 · 8 comments · Fixed by brave/brave-core#12877

Comments

@Miyayes
Copy link
Collaborator

Miyayes commented Mar 31, 2022

Description

@lukaslevert noticed that brave://settings/rewards reports that his Brave Rewards are not enabled, even though he is using Brave Rewards and is verified.

His simultaneous screenshots:

image
image

cc: @GeetaSarvadnya

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Mar 31, 2022

@lukaslevert - Did you reset rewards and enable AC and Ads switches manually?

I can reproduce the issue in the rewards reset case, the steps are mentioned below:

  1. Clean profile 1.37.109 or 1.38.x
  2. Enable rewards via BR panel/NTP/Hamburger menu
  3. Make sure rewards is enabled in both brave://rewards/ and brave://settings/rewards
  4. Reset the rewards via Manage Brave Rewards
  5. Make sure rewards in disabled in brave://settings/rewards
  6. Make sure Ads and AC switches are OFF and rewards is disabled in brave://rewards
  7. Enable the Ads and AC switches manually in the brave://rewrads page
  8. Reload the brave://settings/rewards page
  9. Rewards is still in disabled mode in settings page although it'e enabled in brave://rewards page

@lukaslevert
Copy link

lukaslevert commented Mar 31, 2022 via email

@emerick
Copy link
Contributor

emerick commented Mar 31, 2022

This issue comes about when the brave.rewards.enabled preference (which is essentially our Rewards opt-in preference) gets toggled to false. Looking at our code, I don't see a way for that to occur just by enabling/disabling Ads or Auto-Contribute but I could be missing some subtle interaction there.

I am definitely able to repro the problem when resetting Rewards as in @GeetaSarvadnya's example. The issue in this "reset scenario" is that when a user resets Rewards, as part of that process, we clear all brave.rewards preferences. This includes the brave.rewards.enabled opt-in preference, which is the value that brave://settings/rewards considers when determining if Rewards is enabled or disabled.

In order to fix that particular case, I see three potential approaches:

  1. Resetting Rewards should clear all brave.rewards preferences but it should keep brave.rewards.enabled set to true as the user has already opted-in to Rewards. In fact, this state of affairs is reflected in our UI, as resetting Rewards does not make you opt-in to Rewards again.
  2. Resetting Rewards should clear all brave.rewards preferences including the brave.rewards.enabled "opt-in" preference and the brave://rewards page UI should once again reflect that the user must opt-in to Rewards. (Currently, there is probably some React state that still indicates Rewards is enabled in this scenario, so that would need to be fixed.)
  3. brave://settings could perhaps be made to consider brave.rewards.enabled, the Ads toggle, and the AC toggle. If any one of those are true, then it could consider Rewards to be enabled. I haven't looked deeply into the code to see how feasible this is, but it seems like it could be made to work.

My gut instinct is that 1 would be easiest to achieve and it seems like a reasonable approach that we're already pretty close to. cc: @Miyayes @zenparsing for additional thoughts/opinions.

@GeetaSarvadnya
Copy link

Tried a bunch of cases with Ads/AC enables/disable multiple times unable to reproduce the issue that @lukaslevert mentioned. I could reproduce the issue 100% only with the reset rewards case (mentioned above #22003 (comment))

While testing the issue, found a new bug #22022. Not sure it's expected or not.
cc: @Miyayes @emerick @zenparsing

@emerick
Copy link
Contributor

emerick commented Apr 1, 2022

Spoke with @Miyayes and we'll go with option 2 above (i.e., resetting Rewards should clear all preferences and reset the opt-in state to false as if the user has never seen Rewards before). The Rewards panel actually does seem to show this state correctly after a reset, it's just the brave://rewards page that seems to have cached the opt-in state.

@LaurenWags
Copy link
Member

LaurenWags commented Apr 29, 2022

Verified with

Brave | 1.39.86 Chromium: 101.0.4951.41 (Official Build) beta (x86_64)
-- | --
Revision | 93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}
OS | macOS Version 12.3.1 (Build 21E258)

Verified test plan from brave/brave-core#12877 (comment)

  • Confirmed brave://rewards page showed "opt-in" overlay after resetting rewards
  • Confirmed panel showed rewards onboarding when selected after resetting rewards
  • Confirmed brave://settings/rewards showed correct state (enabled or disabled depending on step from test plan)

@LaurenWags LaurenWags added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Apr 29, 2022
@MadhaviSeelam
Copy link

MadhaviSeelam commented May 9, 2022

Verified PASSED using

Brave 1.39.95 Chromium: 101.0.4951.54 (Official Build) beta (64-bit)
Revision 67da1aeb32cedd27634ca6634fb79cbd85d3f0ab-refs/branch-heads/4951@{#1126}
OS Windows 11 Version 21H2 (Build 22000.613)
  • Install 1.39.95
  • Launch brave
  • Enable Rewards
  • Visit brave://rewards
  • Reset Rewards via "Manage Brave Rewards" button
  • Confirmed brave://rewards page showed "opt-in" overlay after resetting rewards
  • Confirmed panel showed rewards onboarding when selected after resetting rewards
  • Confirmed brave://settings/rewards showed correct state (enabled or disabled depending on step)
ex1 ex2 ex3 ex4 ex5
ResetRewards RewardsPage RewardsPanel Rewardsdisabledafterreset Rewardsenabled

@btlechowski
Copy link

Verification passed on

Brave 1.39.100 Chromium: 101.0.4951.61 (Official Build) beta (64-bit)
Revision 3b3633b32c491b4cba5fd7df3c7c0f628547cbcc-refs/branch-heads/4951@{#1189}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#12877 (comment)

  • Confirmed brave://rewards page showed "opt-in" overlay after resetting rewards
    image
  • Confirmed panel showed rewards onboarding when selected after resetting rewards
    image
  • Confirmed brave://settings/rewards showed correct state (enabled or disabled depending on step from test plan)
    image

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