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

[Desktop] Stop retries if auto contribute or Rewards setting is off #10257

Closed
NejcZdovc opened this issue Jun 15, 2020 · 2 comments · Fixed by brave/brave-core#5900
Closed

[Desktop] Stop retries if auto contribute or Rewards setting is off #10257

NejcZdovc opened this issue Jun 15, 2020 · 2 comments · Fixed by brave/brave-core#5900

Comments

@NejcZdovc
Copy link
Contributor

Right now we check if AC is off only when we start AC process. We should check if AC is off when doing retries as well. We should also check if rewards is off as well.

@NejcZdovc NejcZdovc self-assigned this Jun 15, 2020
@NejcZdovc NejcZdovc changed the title [Desktop] Stop retrying if AC or rewards is off [Desktop] Stop retrying if AC or rewards was turn off Jun 15, 2020
@mandar-brave
Copy link

@NejcZdovc to add to the issue; Monthly contributions should also be turned off immediately when the BR, or M Contributions switch is turned off.

@kjozwiak
Copy link
Member

kjozwiak commented Jul 10, 2020

Verification PASSED on macOS 10.15.5 x64 using the following build:

Brave | 1.12.81 Chromium: 84.0.4147.68 (Official Build) dev (64-bit)
-- | --
Revision | e7b7234037639b407e69c5428c891ce018cd6c0d-refs/branch-heads/4147@{#772}
OS | macOS Version 10.15.5 (Build 19F101)

Basically ran through the cases that @LaurenWags and @GeetaSarvadnya provided via brave/brave-core#5900 (comment).

Test Case #1 (multiple verified publishers in the a-c table using UGP grant)

  • launched using --enable-logging=stderr --vmodule="*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/bat-native-ledger/*"=6 --rewards=staging=true,reconcile-interval=6,short-retries=true
  • enabled rewards and claimed a UGP of 30 BAT
  • added three verified publishers into the a-c table before reconcile-interval=6

Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[19483:775:0709/181922.512886:VERBOSE1:contribution.cc(167)] Staring monthly contribution
[19483:775:0709/181922.515037:VERBOSE1:contribution_ac.cc(32)] Starting auto contribution

Screen Shot 2020-07-09 at 6 23 12 PM

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a tip once the a-c as been interrupted/completed

Test Case #2 (multiple verified publishers in the a-c table using KYC wallet)

  • launched using --enable-logging=stderr --vmodule="*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/bat-native-ledger/*"=6 --rewards=staging=true,reconcile-interval=6,short-retries=true
  • enabled rewards and logged into a KYC account which had 15 BAT
  • added three verified publishers into the a-c table before reconcile-interval=6

Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[20500:775:0710/000612.454295:VERBOSE1:contribution.cc(170)] Staring monthly contribution
[20500:775:0710/000612.457081:VERBOSE1:contribution_ac.cc(33)] Starting auto contribution

Screen Shot 2020-07-10 at 12 08 36 AM

Test Case #3 (multiple verified publishers in the a-c table using anon wallet)

  • launched using --enable-logging=stderr --vmodule="*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/bat-native-ledger/*"=6 --rewards=staging=true,reconcile-interval=6,short-retries=true
  • enabled rewards and restored an anon wallet
  • added three verified publishers into the a-c table before reconcile-interval=6

Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[20698:775:0710/002037.564818:VERBOSE1:contribution.cc(170)] Staring monthly contribution
[20698:775:0710/002037.566922:VERBOSE1:contribution_ac.cc(33)] Starting auto contribution

Screen Shot 2020-07-10 at 12 21 38 AM

[20698:775:0710/002037.564818:VERBOSE1:contribution.cc(170)] Staring monthly contribution
[20698:775:0710/002037.566922:VERBOSE1:contribution_ac.cc(33)] Starting auto contribution
  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a tip once the a-c as been interrupted/completed

Test Case #4 (multiple verified publishers + recurring tips using UGP grant)

  • launched using --enable-logging=stderr --vmodule="*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/bat-native-ledger/*"=6 --rewards=staging=true,reconcile-interval=6,short-retries=true
  • enabled rewards and claimed a UGP of 30 BAT
  • added four verified publishers into the a-c table and three recurring tips before reconcile-interval=6

Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[20860:775:0710/003443.379377:VERBOSE1:contribution.cc(170)] Staring monthly contribution
[20860:775:0710/003443.382980:VERBOSE1:contribution_ac.cc(33)] Starting auto contribution
[20860:775:0710/003445.398179:VERBOSE1:contribution.cc(400)] Creating contribution(blinded) for 0 type RewardsType::RECURRING_TIP

Screen Shot 2020-07-10 at 12 36 04 AM

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured that the recurring tips completed once the browser was restarted and a-c didn't complete
  • ensured you can send a tip once the a-c as been interrupted/completed

Test Case #5 (multiple verified publishers + recurring tips using KYC account)

Basically went through the same steps as Test Case #4 but used a KYC wallet rather than a UGP grant.

Test Case #6 (multiple verified publishers + recurring tips using anon account)

Basically went through the same steps as Test Case #4 but used a anon wallet rather than a UGP grant.


Verification passed on

Brave | 1.11.94 Chromium: 84.0.4147.85 (Official Build) (64-bit)
-- | --
Revision | e20c13e958edc3707db3d26d513780a7f6331a4b-refs/branch-heads/4147@{#837}
OS | Windows 10 OS Version 1903 (Build 18362.900)

Test Case #1 (multiple verified publishers in the a-c table using UGP grant)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[6668:11856:0710/182534.776:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed
    image

Test Case #2 (multiple verified publishers in the a-c table using KYC wallet)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[5936:7644:0710/195544.780:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
    image
    image
    image
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed
    image

Test Case #3 (multiple verified publishers in the a-c table using anon wallet)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[7832:2180:0710/221813.215:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
    image
    image
    image
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed
    image

Test Case #4 (multiple verified publishers + recurring tips using UGP grant)

Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[3432:14584:0710/223340.361:VERBOSE1:contribution.cc(167)] Staring monthly contribution
[3432:14584:0710/223340.362:VERBOSE1:contribution.cc(264)] Timer will start in 15
[3432:14584:0710/223340.363:VERBOSE1:contribution_ac.cc(32)] Starting auto contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
    image
    image
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

Test Case #5 (multiple verified publishers + recurring tips using KYC account)

Basically went through the same steps as Test Case #4 but used a KYC wallet rather than a UGP grant.

-Disabled a-c via brave://rewards and closed the browser once the a-c process started as per the following:

[18376:15712:0710/225258.340:VERBOSE1:contribution.cc(167)] Staring monthly contribution
[18376:15712:0710/225258.342:VERBOSE1:contribution.cc(264)] Timer will start in 23
[18376:15712:0710/225258.342:VERBOSE1:contribution_ac.cc(32)] Starting auto contribution

image

Test Case #6 (multiple verified publishers + recurring tips using anon account)

Basically went through the same steps as Test Case #4 but used a anon wallet rather than a UGP grant.


Verification passed on

Brave 1.11.97 Chromium: 84.0.4147.89 (Official Build) (64-bit)
Revision 19abfe7bcba9318a0b2a6bc6634a67fc834aa592-refs/branch-heads/4147@{#852}
OS Ubuntu 18.04 LTS
Steps

Test Case #1 (multiple verified publishers in the a-c table using UGP grant)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[2630:2630:0715/175043.792212:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed
    image

Test Case #2 (multiple verified publishers in the a-c table using KYC wallet)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[6077:6077:0715/183310.772433:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

Test Case #3 (multiple verified publishers in the a-c table using anon wallet)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
[6974:6974:0715/185135.477992:VERBOSE1:contribution.cc(758)] AC is disabled, completing contribution

image

  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

Test Case #4 (multiple verified publishers + recurring tips using UGP grant)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
    image
  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

Test Case #5 (multiple verified publishers + recurring tips using KYC account)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

Test Case #6 (multiple verified publishers + recurring tips using anon account)

  • When the AC is OFF and the browser is restarted following logs are recorded in logs in the console
  • ensured contribution_info, contribution_info_publisher and unblinded_tokens tables had the correct information/values
  • ensured you can send a one time tip and recurring tips once the a-c as been interrupted, recurring tips are processed

@rebron rebron changed the title [Desktop] Stop retrying if AC or rewards was turn off [Desktop] Stop retries if auto contribute or Rewards setting is off Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment