Skip to content

Start ledger process and load extension (if needed) before opening Rewards panel #12409

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

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Feb 25, 2022

Resolves brave/brave-browser#21311

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@emerick emerick self-assigned this Feb 25, 2022
@emerick emerick marked this pull request as ready for review February 25, 2022 00:46
@emerick emerick requested a review from a team as a code owner February 25, 2022 00:46
@github-actions github-actions bot added rebase and removed rebase labels Feb 25, 2022
@brave-builds brave-builds force-pushed the rewards-adaptive-captcha-solve-doesnt-open-panel branch from 178aa15 to 21a3319 Compare February 25, 2022 00:48
@emerick emerick force-pushed the rewards-adaptive-captcha-solve-doesnt-open-panel branch from 21a3319 to 457c3d8 Compare February 25, 2022 01:03
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code here LGTM! 😄

I had deleted some comments when thinking things through; I was thinking to self, "maybe add pref_change_registrar check for ads preference too (similar to BraveComponentLoader::CheckRewardsStatus)"... but that felt like a hacky suggestion

One thought I did have though EnsureBrowserContextKeyedServiceFactoriesBuilt gets called at profile creation. We could add the call to AddRewardsExtension in the RewardsServiceFactory (ex: inside BuildServiceInstanceFor)

@zenparsing
Copy link
Collaborator

@bsclifton I agree that extension loading should be managed from one place in the code. Unfortunately, as we've baked more UI into the rewards extension, we've added more paths that need the extension loaded. Ultimately though, we'll want to stop using the extension for the panel altogether.

@emerick
Copy link
Contributor Author

emerick commented Feb 25, 2022

@bsclifton @zenparsing If it's OK, I'm going to keep this as-is since the current change is completely isolated to adaptive captcha (that code isn't called from anywhere else) and we want to uplift this into 1.36 ASAP. The Rewards team is meeting today, so I can bring up the long-term plans for extension management (or discuss whether the extension just goes away) at that meeting. Will follow up here with a pointer to issues, etc. post-meeting!

@kjozwiak
Copy link
Member

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.38.6 Chromium: 99.0.4844.45 (Official Build) nightly (64-bit)
-- | --
Revision | edbc0b8343c7b10fddb0e1b4efb280b0f6e38cab-refs/branch-heads/4844@{#788}
OS | Windows 11 Version 21H2 (Build 22000.527)

Verification notes can be found via https://github.com/brave/internal/issues/857#issuecomment-1053884823.

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

Successfully merging this pull request may close these issues.

Clicking solve on adaptive captcha notification doesn't show captcha if auto-contribute disabled
4 participants