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

Rewards extension process needs to be terminated when disabled, Follow up to #1475 #3436

Closed
srirambv opened this issue Feb 21, 2019 · 20 comments · Fixed by brave/brave-core#3698

Comments

@srirambv
Copy link
Contributor

Description

Based on #1475, it only hides the extension from UI but the background process continues to run which is waste of resources. When the extension is hidden from UI corresponding extension process needs to be terminated/killed off to conserve resources

Steps to Reproduce

  1. Disable rewards from UI
  2. Open Browser Task manager
  3. Still shows extension process running even though its hidden

Actual result:

screenshot from 2019-02-21 08-00-12

Expected result:

Should terminate the process when extension is hidden from UI

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 0.61.34 Chromium: 73.0.3683.39 (Official Build) beta(64-bit)
Revision cc53b0e12fcaf42e4bab8d6c23bd4fb7aae99f6c-refs/branch-heads/3683@{#413}
OS Linux

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds?
    Yes

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields?
  • Is the issue reproducible on the latest version of Chrome?

Additional Information

@kklot
Copy link

kklot commented Feb 24, 2019

Because of this tiny icon Brave is a goner for me.

@maclarel
Copy link

maclarel commented Mar 1, 2019

Brave is getting a hard pass from me until this is resolved. Wasting resources on something that is claimed to "do nothing" is incredibly shady.

@ghug
Copy link

ghug commented Mar 11, 2019

Shouldn't disabling rewards also terminate the Bat Ledger Service?

The rewards extension can be manually disabled for now with the command line argument --disable-brave-rewards-extension, but the Bat Ledger Service cannot be so easily disabled yet.

@bsclifton
Copy link
Member

I think a patch like this would work- but you'd need to restart the browser if you wanted to either stop the process now or re-enable rewards

diff --git a/browser/extensions/brave_component_loader.cc b/browser/extensions/brave_component_loader.cc
index 11f0ab83a..19b499715 100644
--- a/browser/extensions/brave_component_loader.cc
+++ b/browser/extensions/brave_component_loader.cc
@@ -108,7 +108,8 @@ void BraveComponentLoader::AddDefaultComponentExtensions(
   }

 #if BUILDFLAG(BRAVE_REWARDS_ENABLED)
-  if (!command_line.HasSwitch(switches::kDisableBraveRewardsExtension)) {
+  if (!profile_prefs_->GetBoolean(kHideBraveRewardsButton) &&
+    !command_line.HasSwitch(switches::kDisableBraveRewardsExtension)) {
     base::FilePath brave_rewards_path(FILE_PATH_LITERAL(""));
     brave_rewards_path =
         brave_rewards_path.Append(FILE_PATH_LITERAL("brave_rewards"));

@simonhong
Copy link
Member

@bsclifton I think @gabrielhug also want to prevent launching Bat Ledger Service.
For now, I think we don't have command line switch for that.
Disabling brave rewards is needed to prevent extension and utility service process.(#1475 (comment))

@dylanh724
Copy link

What is the current status of this issue?

@srirambv
Copy link
Contributor Author

+1 from @foamz via #4659

@rebron
Copy link
Collaborator

rebron commented Jun 8, 2019

+1 from @bughit via #4612

@bridiver
Copy link
Contributor

bridiver commented Jun 16, 2019

The problem is "persistent": true in the manifest. The extension (which is just UI and does nothing without the actual service running) is always enabled to show the brave rewards icon, but there is no reason for the background page to be persistent. We should probably have an advanced option to completely disable the extension and remove the rewards icon, but without the background page running the only impact is the extension icon in the urlbar

@bridiver
Copy link
Contributor

a non persistent background page is also better for resource usage when rewards is enabled

@Brave-Matt
Copy link

+1 reddit:
https://www.reddit.com/r/brave_browser/comments/aygxis/how_to_disable_bat_ledger_service/exnhqop?utm_source=share&utm_medium=web2x

@Brave-Matt
Copy link

+1 https://www.reddit.com/r/brave_browser/comments/aygxis/how_to_disable_bat_ledger_service/exo9wtk?utm_source=share&utm_medium=web2x

@jhult
Copy link

jhult commented Sep 19, 2019

Any updates on this? I'm losing ~200 MB to stuff I don't use.

@whoisarpit
Copy link

As a user with 4 gigs of RAM, those ~200MBs are really precious to me.
+1

@ilyaigpetrov
Copy link

I'm on Brave Nightly 0.73.26 and still see Brave Rewards and Bat Ledger Service eating memory in task manager of brave. I made sure that I disabled rewards in settings and restarted brave.

@bsclifton
Copy link
Member

@ilyaigpetrov looking at master:
https://github.com/brave/brave-core/commits/master

Doesn't seem there's been a version published (yet) which has this fix. You can either hang tight until a new one goes public (should happen tomorrow) or you can download the latest non-published Nightly here:
https://github.com/brave/brave-browser/releases/tag/v0.73.31

@LaurenWags
Copy link
Member

LaurenWags commented Oct 30, 2019

Verified passed with

Brave 0.71.105 Chromium: 78.0.3904.70 (Official Build) beta (64-bit)
Revision edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS macOS Version 10.13.6 (Build 17G5019)

1-before clicking on BAT logo

After clicking on BAT logo:

1-after clicking on BAT logo

Test plan 2 (single profile) upgraded profile with BR already on/opt-ed in:
2

  • Confirmed test plans 1&2 work as expected when a second profile is added.

Verification passed on

Brave 0.71.105 Chromium: 78.0.3904.70 (Official Build) beta (64-bit)
Revision edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS Ubuntu 18.04 LTS

Encountered #5429, #6663

Verified upgrade profile and multi profile
image

Verification passed on

Brave 0.71.106 Chromium: 78.0.3904.70 (Official Build) beta (64-bit)
Revision edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS Windows 10 OS Version 1803 (Build 17134.1006)

Test plan 1 - before clicking on rewards BAT icon, brave rewards extension is not loaded

image

Test plan 1 - After clicking on rewards BAT icon, brave rewards extension is loaded
image

  • Test plan 2 (single profile) upgraded profile with BR already on/opt-ed in:

image

  • Confirmed test plans 1&2 work as expected when a second profile is added.

image

image

@ask1234560
Copy link

Hi guys, any updates on this. I am still facing the issue.
Brave version - 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)

@ghost
Copy link

ghost commented Mar 18, 2023

Utility: Bat Ledger Service Still running
image

@ask1234560
Copy link

Utility: Bat Ledger Service Still running image

+1, issue exists

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