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

Migrate away from Rewards Extension to WebUI: Make background page of Reward Extension non-persistent #22423

Closed
atuchin-m opened this issue Apr 20, 2022 · 4 comments · Fixed by brave/brave-core#13719
Assignees

Comments

@atuchin-m
Copy link
Contributor

atuchin-m commented Apr 20, 2022

Currently if rewards is enabled Reward Extension lives forever and consumes user memory.
The extension process should be launched only if the panel opened.

The entry point in the code: brave_rewards_panel_background.js

slack discussion: https://bravesoftware.slack.com/archives/CNH9Q6REV/p1650469219904509
image (16)

@Miyayes Miyayes added feature/rewards OS/Android Fixes related to Android browser functionality labels Apr 20, 2022
@Miyayes Miyayes added the priority/P3 The next thing for us to work on. It'll ride the trains. label May 25, 2022
@Miyayes Miyayes changed the title Make background page of Reward Extension non-persistent Migrate away from using Rewards Extension: Make background page of Reward Extension non-persistent May 27, 2022
@Miyayes Miyayes changed the title Migrate away from using Rewards Extension: Make background page of Reward Extension non-persistent Migrate away from Rewards Extension to WebUI: Make background page of Reward Extension non-persistent Jun 6, 2022
@brave-builds brave-builds added this to the 1.43.x - Nightly milestone Jul 8, 2022
@LaurenWags
Copy link
Member

Marking as QA/Blocked until #24546 is resolved via Griffin. Worst case scenario we can test via flag manipulation on brave://flags.

@LaurenWags
Copy link
Member

LaurenWags commented Aug 16, 2022

Verified with

Brave | 1.43.73 Chromium: 104.0.5112.81 (Official Build) beta (x86_64)
-- | --
Revision | 5b7b76419d50f583022568b6764b630f6ddc9208-refs/branch-heads/5112@{#1309}
OS | macOS Version 12.5 (Build 21G72)
WebUI panel disabled - PASSED

Verified the following items from brave/brave-core#13719 (comment) for when the feature flag, #brave-rewards-webui-panel, is disabled. Note, this must be done manually as it is enabled via griffin for Nightly and Beta currently.

  • All strings on the Rewards panel are displayed properly.

Uphold/Gemini region onboarding:

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

bitFlyer region onboarding:

1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8

Various panel views:

Notification Summary Creator Custodian drop-down
2 3 4 5

Ad grant panel modals:

Example Example Example
2 3 4
Brave | 1.43.74 Chromium: 104.0.5112.102 (Official Build) beta (x86_64)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | macOS Version 12.5 (Build 21G72)
  • Publisher info is displayed properly in the panel for a variety of publishers.
    • Used a mix of verified and not verified creators below to display the various creator types
Site YouTube Vimeo Reddit Twitch Twitter GitHub
2 -unverified site 3 -verified YT 4 -unverified vimeo 5 -verified reddit 6 -unverified twitch 7 -verified twitter 8 -unverified GH
  • Confirmed after enabling Rewards from the NTP, the panel is opened with the Rewards tour displayed.
Example Example
2 3
  • Adaptive captcha items:
    • Confirmed received adaptive captcha at appropriate time when scheduled
    • Confirmed adaptive captcha is displayed correctly when the user clicks on the "Solve" button for adaptive captcha
    • Confirmed able to solve adaptive captcha successfully
    • Confirmed able to select "Later" and the prompt is displayed later
    • Confirmed able to fail captcha several times and then pass successfully
    • Confirmed if Rewards icon is hidden, when clicking on "Solve", the Rewards icon shows, the panel opens, and the adaptive captcha is displayed
    • Confirmed if I click "Solve" on the prompt, the adaptive captcha is shown on the panel. If I then close the panel, and reopen it - the adaptive captcha is still there, waiting to be solved.
    • Confirmed if the max attempts at the captcha are met without success, there is UI instructing the user to contact support
    • Confirmed the "Contact Support" button opens Brave Help Center in a new tab
Example Example Example Example Example
2 3 4 5 6
  • Ad grant claims from NTP and brave://rewards
    • Confirmed ad grant captchas can be opened from the NTP
    • Confirmed ad grant captchas can be successfully claimed
    • Confirmed ad grant captchas can be opened from brave://rewards
    • Confirmed ad grant captchas can be successfully claimed
Claim Ad grant from NTP Claim Ad grant from NTP Claim Ad grant from brave://rewards Claim Ad grant from brave://rewards
2 3 5 6
  • Confirmed rewards icon "checkmark" state and publisher info is correct for Greaselion publishers:

Brave Verified creators:

GitHub Twitter Reddit YouTube Vimeo Twitch
2 -GH 3 -Twitter 4 -Reddit YT vimeo twitch

Non Verified creators:

GitHub Twitter Reddit YouTube Vimeo Twitch
u - GH u - Twitter u - Reddit u - SNL u - vimeo u -twitch
  • Confirmed the Rewards panel can be opened from the settings page when the user has not enabled Rewards.
Example Example
1 2
Brave | 1.43.74 Chromium: 104.0.5112.102 (Official Build) beta (x86_64)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | macOS Version 12.5 (Build 21G72)
WebUI panel enabled - PASSED, follow up issue logged

Verified the following items from brave/brave-core#13719 (comment) for when the feature flag, #brave-rewards-webui-panel, is enabled. Note, must restart on Nightly/Beta so that the BraveRewardsWebUiPanelStudy:Enabled is shown on brave://version as this is the Griffin study which enables this flag. Alternatively, you could manually enable the flag which requires a browser restart.

  • All strings on the Rewards panel are displayed properly.

Uphold/Gemini region onboarding:

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

bitFlyer region onboarding:

1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8

Various panel views:

Notification Summary Creator Custodian drop-down
Screen Shot 2022-08-18 at 1 36 13 PM Screen Shot 2022-08-18 at 1 55 12 PM Screen Shot 2022-08-18 at 1 55 38 PM Screen Shot 2022-08-18 at 1 56 44 PM

Ad Grant panel modals:

Example Example Example
Screen Shot 2022-08-18 at 2 04 19 PM Screen Shot 2022-08-18 at 2 04 29 PM Screen Shot 2022-08-18 at 2 04 38 PM
  • Publisher info is displayed properly in the panel for a variety of publishers.
    • Used a mix of verified and not verified creators below to display the various creator types
Site YouTube Vimeo Reddit Twitch Twitter GitHub
1 2 3 4 5 6 7
  • After enabling Rewards from the NTP, the panel is opened with the Rewards tour displayed.
Example Example
Screen Shot 2022-08-18 at 4 37 53 PM Screen Shot 2022-08-18 at 4 38 05 PM
  • Adaptive captcha items:
    • Confirmed received adaptive captcha at appropriate time when scheduled
    • Confirmed adaptive captcha is displayed correctly when the user clicks on the "Solve" button for adaptive captcha
    • Confirmed able to solve adaptive captcha successfully
    • Confirmed able to select "Later" and the prompt is displayed later
    • Confirmed able to fail captcha several times and then pass successfully
    • Confirmed if Rewards icon is hidden, when clicking on "Solve", the Rewards icon shows, the panel opens, and the adaptive captcha is displayed
    • Confirmed if I click "Solve" on the prompt, the adaptive captcha is shown on the panel. If I then close the panel, and reopen it - the adaptive captcha is still there, waiting to be solved.
    • Confirmed if the max attempts at the captcha are met without success, there is UI instructing the user to contact support
    • FAILED - the "Contact Support" button does not open Brave Help Center in a new tab, logged follow up issue "Contact Support" from adaptive captcha doesn't work with WebUI rewards panel #24846
Example Example Example Example
Screen Shot 2022-08-22 at 8 49 41 AM Screen Shot 2022-08-22 at 8 56 01 AM Screen Shot 2022-08-22 at 8 56 18 AM Screen Shot 2022-08-22 at 9 02 27 AM
  • Ad grant claims from NTP and brave://rewards
    • Confirmed ad grant captchas can be opened from the NTP
    • Confirmed ad grant captchas can be successfully claimed
    • Confirmed ad grant captchas can be opened from brave://rewards
    • Confirmed ad grant captchas can be successfully claimed
Claim Ad grant from NTP Claim Ad grant from NTP Claim Ad grant from brave://rewards Claim Ad grant from brave://rewards
Screen Shot 2022-08-22 at 9 39 27 AM Screen Shot 2022-08-22 at 9 39 38 AM Screen Shot 2022-08-22 at 9 48 13 AM Screen Shot 2022-08-22 at 9 48 22 AM
  • Button "checkmark" state and publisher info is correct for Greaselion publishers.

Brave Verified creators:

GitHub Twitter Reddit YouTube Vimeo Twitch
1 2 3 4 5 6

Non Verified creators:

GitHub Twitter Reddit YouTube Vimeo Twitch
7 8 9 10 11 12
  • Confirmed the Rewards panel can be opened from the settings page when the user has not enabled Rewards.
Example Example
Screen Shot 2022-08-22 at 10 10 40 AM Screen Shot 2022-08-22 at 10 10 51 AM
  • For a variety of publishers, the Rewards icon shows the correct "checkmark" badge.
    • See above for GL publisher checks for both verified and non-verified creators
    • See below for regular site checks for both verified and non-verified creators

Brave Verified sites (staging):

Example Example Example
Screen Shot 2022-08-22 at 10 17 10 AM Screen Shot 2022-08-22 at 10 19 01 AM Screen Shot 2022-08-22 at 10 19 34 AM

Non Verified sites (staging):

Example Example Example
Screen Shot 2022-08-22 at 10 21 16 AM Screen Shot 2022-08-22 at 10 22 00 AM Screen Shot 2022-08-22 at 10 23 09 AM
  • Confirmed the Rewards icon shows the correct notification count badge when there are Rewards notifications.
    • Confirmed the count decreases as notifications are removed from panel
Example Example Example Example
1 2 3 4
5 6 7 8
9 10 11 12
  • Confirmed hiding the rewards icon works
    • Confirmed when the Rewards icon is hidden in settings, the Rewards icon does not appear
    • Confirmed this selection is retained on relaunch
    • Confirmed able to hide rewards icon via right click on rewards icon in URL bar and via brave://settings/appearance
Example Example
Screen Shot 2022-08-22 at 11 57 22 AM Screen Shot 2022-08-22 at 11 58 44 AM
  • Confirmed when the Rewards icon is hidden in settings:
    • the panel can still be opened from brave://settings/rewards (onboarding)
    • the panel can still be opened from NTP (onboarding)
    • the panel can still be opened from NTP (Ad grant claim)
    • the panel can still be opened from brave://rewards page (ad grant claim)
    • the panel can still be opened for adaptive captcha solving (see Adaptive Captcha section above)
Rewards icon off brave://settings/rewards NTP NTP brave://rewards
1 2 3 4 5
  • Confirmed when in a "private" context (i.e. a private window or tor window), the Rewards icon does not appear.
Normal Window Private Window Guest Window Tor Window
Screen Shot 2022-08-22 at 1 25 25 PM Screen Shot 2022-08-22 at 1 25 39 PM Screen Shot 2022-08-22 at 1 25 53 PM Screen Shot 2022-08-22 at 1 26 01 PM

Additionally, special attention was given to the panel with the webui flag enabled while testing the following:

@LaurenWags LaurenWags added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Aug 17, 2022
@LaurenWags LaurenWags added QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Aug 22, 2022
@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Aug 23, 2022

Verification PASSED on

Brave | 1.43.78 Chromium: 104.0.5112.102 (Official Build) beta (64-bit)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | Windows 10 Version 21H2 (Build 19044.1889)

  • Adaptive captcha items:
    • Confirmed received adaptive captcha at appropriate time when scheduled
    • Confirmed adaptive captcha is displayed correctly when the user clicks on the "Solve" button for adaptive captcha
    • Confirmed able to solve adaptive captcha successfully
    • Confirmed able to select "Later" and the prompt is displayed later
    • Confirmed able to fail captcha several times and then pass successfully
    • Confirmed if Rewards icon is hidden, when clicking on "Solve", the Rewards icon shows, the panel opens, and the adaptive captcha is displayed
    • Confirmed if I click "Solve" on the prompt, the adaptive captcha is shown on the panel. If I then close the panel, and reopen it - the adaptive captcha is still there, waiting to be solved.
    • Confirmed if the max attempts at the captcha are met without success, there is UI instructing the user to contact support
    • Confirmed the "Contact Support" button opens Brave Help Center in a new tab
Example Example Example Example Example
image image image (1) image image
  • Adaptive captcha items:
    • Confirmed received adaptive captcha at appropriate time when scheduled
    • Confirmed adaptive captcha is displayed correctly when the user clicks on the "Solve" button for adaptive captcha
    • Confirmed able to solve adaptive captcha successfully
    • Confirmed able to select "Later" and the prompt is displayed later
    • Confirmed able to fail captcha several times and then pass successfully
    • Confirmed if Rewards icon is hidden, when clicking on "Solve", the Rewards icon shows, the panel opens, and the adaptive captcha is displayed
    • Confirmed if I click "Solve" on the prompt, the adaptive captcha is shown on the panel. If I then close the panel, and reopen it the adaptive captcha is still there, waiting to be solved.
    • Confirmed if the max attempts at the captcha are met without success, there is UI instructing the user to contact support
    • FAILED - the "Contact Support" button does not open Brave Help Center in a new tab, encountered the issue "Contact Support" from adaptive captcha doesn't work with WebUI rewards panel #24846
Example Example Example Example
image image image (1) image

@LaurenWags LaurenWags removed the OS/Android Fixes related to Android browser functionality label Aug 23, 2022
@LaurenWags
Copy link
Member

LaurenWags commented Aug 23, 2022

Per discussion with @zenparsing @Miyayes, removed the OS/Android tag as there were no Android changes with this issue.

cc @kjozwiak @srirambv @Uni-verse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants