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

BAT Confirmations should not be started if Rewards is disabled #9544

Closed
tmancey opened this issue Apr 30, 2020 · 3 comments · Fixed by brave/brave-core#5424
Closed

BAT Confirmations should not be started if Rewards is disabled #9544

tmancey opened this issue Apr 30, 2020 · 3 comments · Fixed by brave/brave-core#5424

Comments

@tmancey
Copy link
Contributor

tmancey commented Apr 30, 2020

BAT Confirmations should not be started if Rewards is disabled

@btlechowski
Copy link

@tmancey I can see confirmations being initialized on clean profile(Started Brave on clean profile). Is this expected?

[15253:15253:0604/035425.021553:INFO:confirmations_impl.cc(57)] Initializing confirmations
Brave 1.10.82 Chromium: 81.0.4044.138 (Official Build) dev (64-bit)
Revision 8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}
OS Ubuntu 18.04 LTS

@btlechowski
Copy link

Talked to @tmancey. The above is not expected, but it does not reproduce in 1.11.x. I logged #10085

@btlechowski
Copy link

btlechowski commented Jun 10, 2020

Verification passed on

Brave 1.10.87 Chromium: 83.0.4103.61 (Official Build) (64-bit)
Revision 94f915a8d7c408b09cc7352161ad592299f384d2-refs/branch-heads/4103@{#561}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#5424.
Verified confirmations are not initialized when rewards are disabled or never enabled.
Failed On Fresh install - Run Browser and check logs - encountered #10085
On Fresh install - verified enabling rewards from the URL bar, then disabling rewards and restarting the browser.
On Fresh install - verified enabling rewards from on-boarding, then disabling rewards and restarting the browser.
On Fresh install - verified enabling rewards from brave://rewards, then disabling rewards and restarting the browser.
On Fresh install - Toggle rewards off and back on. Verified BAT confirmations are not started when rewards are off and are started when rewards are on
When enabled:

[16597:16597:0610/230612.326487:INFO:confirmations_impl.cc(57)] Initializing confirmations

When disabled:

[16597:16597:0610/230719.872031:INFO:ledger_impl.cc(233)] Successfully shutdown confirmations

Failed on upgrade from 1.9.x - rewards never enabled in 1.9.x - encountered #10085
Verified on upgrade from 1.9.x - rewards enabled and disabled in 1.9.x

Failed on upgrade from 0.61.x - rewards never enabled in 0.61.x - encountered #10085
Verified on upgrade from 0.61.x - rewards enabled and disabled in 0.61.x
Used https://github.com/brave/brave-browser/releases/tag/v0.61.52.


Verified passed using

Brave	1.10.90 Chromium: 83.0.4103.97 (Official Build) (64-bit)
Revision	326d148b9655369b86498d9ecca39f63dd2bdd2d-refs/branch-heads/4103@{#657}
OS	macOS Version 10.14.6 (Build 18G3020)
  1. Upgrade from 1.9.80 - FAIL
    Saw this in terminal w/ clean install of 1.9.80, did not enable rewards:
Laurens-MacBook-Pro-2:~ lauren$ /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
[19790:775:0612/121253.406842:INFO:confirmations_impl.cc(57)] Initializing confirmations
[19790:775:0612/121253.406988:INFO:confirmations_impl.cc(760)] Loading confirmations state
[19776:775:0612/121253.494942:ERROR:browser_switcher_service.cc(238)] XXX Init()
[19776:37379:0612/121253.945664:ERROR:rewards_service_impl.cc(244)] Failed to read file: /Users/lauren/Library/Application Support/BraveSoftware/Brave-Browser/Default/rewards_service/confirmations.json
[19790:775:0612/121253.984416:ERROR:confirmations_impl.cc(774)] Failed to load confirmations state, resetting to default values
[19790:775:0612/121253.985311:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19790:775:0612/121253.985490:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19790:775:0612/121253.985556:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19790:775:0612/121254.015007:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[19790:775:0612/121254.044542:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[19790:775:0612/121254.093867:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state

Upgraded to 1.10.90 and still saw confirmations initiated. Reproduced #10085

Laurens-MacBook-Pro-2:~ lauren$ /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
[19936:775:0612/121619.189383:INFO:confirmations_impl.cc(57)] Initializing confirmations
[19936:775:0612/121619.189515:INFO:confirmations_impl.cc(760)] Loading confirmations state
[19936:775:0612/121619.194902:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[19936:775:0612/121619.195765:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19936:775:0612/121619.196055:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19936:775:0612/121619.196140:INFO:confirmations_impl.cc(740)] Saving confirmations state
[19936:775:0612/121619.214243:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[19936:775:0612/121619.222325:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[19936:775:0612/121619.233468:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[19936:775:0612/121619.235204:INFO:database_migration.cc(73)] DB: Migrated to version 19
[19936:775:0612/121619.235424:INFO:database_migration.cc(73)] DB: Migrated to version 20
[19936:775:0612/121619.235546:INFO:database_migration.cc(73)] DB: Migrated to version 21
[19923:59651:0612/121619.245057:ERROR:rewards_service_impl.cc(191)] Failed to read file: /Users/lauren/Library/Application Support/BraveSoftware/Brave-Browser/Default/ledger_state
[19936:775:0612/121619.246134:ERROR:ledger_impl.cc(122)] Failed to initialize wallet
  1. Fresh install, enable Rewards from BAT logo in URL Bar. Close, restart browser. Confirmed confirmations started. - PASS
Laurens-MacBook-Pro-2:~ lauren$ /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
[20011:775:0612/123520.410488:INFO:confirmations_impl.cc(57)] Initializing confirmations
[20011:775:0612/123520.410566:INFO:confirmations_impl.cc(760)] Loading confirmations state
[20011:775:0612/123520.416152:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[20011:775:0612/123520.417025:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20011:775:0612/123520.417568:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20011:775:0612/123520.418339:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20011:775:0612/123520.437975:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20011:775:0612/123520.444963:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20011:775:0612/123520.445927:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
  1. Fresh install, enable Rewards from on boarding. Close, restart browser. Confirmed confirmations started. - PASS
Laurens-MacBook-Pro-2:~ lauren$ /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
[20062:775:0612/124015.680996:INFO:confirmations_impl.cc(57)] Initializing confirmations
[20062:775:0612/124015.681165:INFO:confirmations_impl.cc(760)] Loading confirmations state
[20062:775:0612/124015.699320:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[20062:775:0612/124015.704613:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20062:775:0612/124015.705161:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20062:775:0612/124015.705878:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20062:775:0612/124015.729067:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20062:775:0612/124015.731096:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20062:775:0612/124015.744071:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
  1. Install 1.9.80. Enable Rewards. Upgrade to 1.10.x. Confirmed confirmations started. - PASS

1.10.x logs:

Laurens-MacBook-Pro-2:~ lauren$ /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --enable-logging=stderr --vmodule=brave_ads=3 --log-level=2
[20190:775:0612/124627.088967:INFO:confirmations_impl.cc(57)] Initializing confirmations
[20190:775:0612/124627.089089:INFO:confirmations_impl.cc(760)] Loading confirmations state
[20190:775:0612/124627.095639:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[20190:775:0612/124627.097041:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124627.100493:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124627.103488:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124627.118332:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20190:775:0612/124627.122813:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[20190:775:0612/124627.129673:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
  1. Fresh install, do not enable Rewards at all. Saw confirmations initiated. Reproduced BAT confirmations are initialized on clean profile #10085 - FAIL

  2. Upgrade from 0.61.x. Reproduced BAT confirmations are initialized on clean profile #10085 - FAIL

  3. Toggle rewards off, back on. Confirmed confirmations restarted on toggling Rewards back on. - PASS

When toggling Rewards off:

[20190:775:0612/124707.103482:INFO:ledger_impl.cc(233)] Successfully shutdown confirmations

When toggling Rewards on:

[20190:775:0612/124753.194722:INFO:confirmations_impl.cc(57)] Initializing confirmations
[20190:775:0612/124753.194761:INFO:confirmations_impl.cc(760)] Loading confirmations state
[20190:775:0612/124753.208075:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[20190:775:0612/124753.208388:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124753.208743:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124753.209346:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20190:775:0612/124753.209894:INFO:ledger_impl.cc(224)] Successfully started confirmations
  1. Toggle rewards off, restart, toggle back on. Confirmed no confirmations messages in the logs on browser Restart when Rewards were explicitly toggled off. - PASS

When toggling Rewards back on:

[20218:775:0612/124959.567389:INFO:confirmations_impl.cc(57)] Initializing confirmations
[20218:775:0612/124959.567420:INFO:confirmations_impl.cc(760)] Loading confirmations state
[20219:775:0612/124959.567316:INFO:ads_impl.cc(118)] Initializing ads
[20210:37891:0612/124959.567876:ERROR:ads_service_impl.cc(202)] Failed to read file: /Users/lauren/Library/Application Support/BraveSoftware/Brave-Browser/Default/ads_service/client.json
[20219:775:0612/124959.568009:ERROR:client.cc(607)] Failed to load client state, resetting to default values
[20210:37891:0612/124959.583007:ERROR:ads_service_impl.cc(202)] Failed to read file: /Users/lauren/Library/Application Support/BraveSoftware/Brave-Browser/Default/ads_service/notifications.json
[20218:775:0612/124959.583152:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[20219:775:0612/124959.583075:INFO:client.cc(593)] Successfully saved client state
[20218:775:0612/124959.583866:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20219:775:0612/124959.583807:ERROR:ad_notifications.cc(335)] Failed to load notifications state, resetting to default values
[20218:775:0612/124959.584374:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20219:775:0612/124959.584151:INFO:ad_notifications.cc(307)] Saving notifications state
[20218:775:0612/124959.585030:INFO:confirmations_impl.cc(740)] Saving confirmations state
[20218:775:0612/124959.585556:INFO:ledger_impl.cc(224)] Successfully started confirmations
  1. iOS - Logged BAT Confirmations should not be started if Rewards is disabled brave-ios#2629 so the issue gets checked on iOS.

Verification passed on

Brave | 1.10.90 Chromium: 83.0.4103.97 (Official Build) (64-bit)
-- | --
Revision | 326d148b9655369b86498d9ecca39f63dd2bdd2d-refs/branch-heads/4103@{#657}
OS | Windows 10 OS Version 1903 (Build 18362.30)

  1. Upgrade from 1.9.80 - FAIL
    Saw this in terminal w/ clean install of 1.9.80, did not enable rewards:
[15172:15168:0615/171001.767:INFO:confirmations_impl.cc(57)] Initializing confirmations
[15172:15168:0615/171001.767:INFO:confirmations_impl.cc(760)] Loading confirmations state
[3740:2956:0615/171001.771:ERROR:rewards_service_impl.cc(242)] Failed to read file: C:\Users\DELL\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\rewards_service\confirmations.json
[15172:15168:0615/171001.772:ERROR:confirmations_impl.cc(774)] Failed to load confirmations state, resetting to default values
[15172:15168:0615/171001.774:INFO:confirmations_impl.cc(740)] Saving confirmations state
[15172:15168:0615/171001.774:INFO:confirmations_impl.cc(740)] Saving confirmations state
[15172:15168:0615/171001.780:INFO:confirmations_impl.cc(740)] Saving confirmations state
[15172:15168:0615/171001.786:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[15172:15168:0615/171001.794:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[15172:15168:0615/171001.799:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state

Upgraded to 1.10.90 and still saw confirmations initiated. Reproduced #10085

[7344:11320:0615/172031.157:INFO:confirmations_impl.cc(57)] Initializing confirmations
[7344:11320:0615/172031.157:INFO:confirmations_impl.cc(760)] Loading confirmations state
[7344:11320:0615/172031.160:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[7344:11320:0615/172031.161:INFO:confirmations_impl.cc(740)] Saving confirmations state
[7344:11320:0615/172031.161:INFO:confirmations_impl.cc(740)] Saving confirmations state
[7344:11320:0615/172031.161:INFO:confirmations_impl.cc(740)] Saving confirmations state
[7344:11320:0615/172031.181:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[7344:11320:0615/172031.205:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[7344:11320:0615/172031.228:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[9740:7312:0615/172031.229:ERROR:rewards_service_impl.cc(191)] Failed to read file: C:\Users\DELL\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\ledger_state
[7344:11320:0615/172031.230:ERROR:ledger_impl.cc(122)] Failed to initialize wallet
  1. Fresh install, enable Rewards from BAT logo in URL Bar. Close, restart browser. Confirmed confirmations started. - PASS
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(57)] Initializing confirmations
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(760)] Loading confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(740)] Saving confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(740)] Saving confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(740)] Saving confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[2508:11552:0615/172420.233:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[2508:11552:0615/172420.251:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[2508:11552:0615/172420.253:VERBOSE1:ledger_impl.cc(538)] 
  1. Fresh install, enable Rewards from on boarding. Close, restart browser. Confirmed confirmations started. - PASS
[16180:15196:0615/172704.253:INFO:confirmations_impl.cc(57)] Initializing confirmations
[16180:15196:0615/172704.253:INFO:confirmations_impl.cc(760)] Loading confirmations state
[16180:15196:0615/172704.255:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[16180:15196:0615/172704.255:INFO:confirmations_impl.cc(740)] Saving confirmations state
[16180:15196:0615/172704.255:INFO:confirmations_impl.cc(740)] Saving confirmations state
[16180:15196:0615/172704.255:INFO:confirmations_impl.cc(740)] Saving confirmations state
[16180:15196:0615/172704.264:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[16180:15196:0615/172704.267:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[16180:15196:0615/172704.272:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
  1. Install 1.9.80. Enable Rewards. Upgrade to 1.10.x. Confirmed confirmations started. - PASS

1.10.x logs:

[14020:11012:0615/173211.656:INFO:confirmations_impl.cc(57)] Initializing confirmations
[14020:11012:0615/173211.656:INFO:confirmations_impl.cc(760)] Loading confirmations state
[14020:11012:0615/173211.662:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[14020:11012:0615/173211.663:INFO:confirmations_impl.cc(740)] Saving confirmations state
[14020:11012:0615/173211.664:INFO:confirmations_impl.cc(740)] Saving confirmations state
[14020:11012:0615/173211.664:INFO:confirmations_impl.cc(740)] Saving confirmations state
[14020:11012:0615/173211.681:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[14020:11012:0615/173211.685:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[14020:11012:0615/173211.685:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
  1. Fresh install, do not enable Rewards at all. Saw confirmations initiated. Reproduced BAT confirmations are initialized on clean profile #10085 - FAIL

  2. Upgrade from 0.61.x. Reproduced BAT confirmations are initialized on clean profile #10085 - FAIL

  3. Toggle rewards off, back on. Confirmed confirmations restarted on toggling Rewards back on. - PASS

When toggling Rewards off:

[3664:12024:0615/174133.288:INFO:ledger_impl.cc(233)] Successfully shutdown confirmations

When toggling Rewards on:

[3664:12024:0615/174227.595:INFO:confirmations_impl.cc(57)] Initializing confirmations
[3664:12024:0615/174227.595:INFO:confirmations_impl.cc(760)] Loading confirmations state
[3664:12024:0615/174227.602:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[3664:12024:0615/174227.602:INFO:confirmations_impl.cc(740)] Saving confirmations state
[3664:12024:0615/174227.602:INFO:confirmations_impl.cc(740)] Saving confirmations state
[3664:12024:0615/174227.602:INFO:confirmations_impl.cc(740)] Saving confirmations state
[3664:12024:0615/174227.602:INFO:ledger_impl.cc(224)] Successfully started confirmations
[3664:12024:0615/174227.605:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[3664:12024:0615/174227.608:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[3664:12024:0615/174227.611:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state

8 .Toggle rewards off, restart, toggle back on. Confirmed no confirmations messages in the logs on browser Restart when Rewards were explicitly toggled off. - PASS

[8752:5724:0615/174645.165:INFO:confirmations_impl.cc(57)] Initializing confirmations
[8752:5724:0615/174645.165:INFO:confirmations_impl.cc(760)] Loading confirmations state
[5292:5456:0615/174645.166:ERROR:ads_service_impl.cc(202)] Failed to read file: C:\Users\DELL\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\ads_service\client.json
[8752:5724:0615/174645.171:INFO:confirmations_impl.cc(779)] Successfully loaded confirmations state
[8752:5724:0615/174645.171:INFO:confirmations_impl.cc(740)] Saving confirmations state
[8752:5724:0615/174645.172:INFO:confirmations_impl.cc(740)] Saving confirmations state
[4064:8848:0615/174645.172:ERROR:client.cc(607)] Failed to load client state, resetting to default values
[8752:5724:0615/174645.172:INFO:confirmations_impl.cc(740)] Saving confirmations state
[8752:5724:0615/174645.173:INFO:ledger_impl.cc(224)] Successfully started confirmations
[4064:8848:0615/174645.176:INFO:client.cc(593)] Successfully saved client state
[5292:5456:0615/174645.176:ERROR:ads_service_impl.cc(202)] Failed to read file: C:\Users\DELL\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\ads_service\notifications.json
[4064:8848:0615/174645.176:ERROR:ad_notifications.cc(335)] Failed to load notifications state, resetting to default values
[4064:8848:0615/174645.176:INFO:ad_notifications.cc(307)] Saving notifications state
[8752:5724:0615/174645.178:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state
[8752:5724:0615/174645.182:INFO:confirmations_impl.cc(756)] Successfully saved confirmations state

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

Successfully merging a pull request may close this issue.

5 participants