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

Do not retry if rewards is off or AC is off #5900

Merged
merged 1 commit into from
Jun 19, 2020
Merged

Do not retry if rewards is off or AC is off #5900

merged 1 commit into from
Jun 19, 2020

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jun 18, 2020

Resolves brave/brave-browser#10257

Submitter Checklist:

Test Plan:

  • enable rewards
  • add multiple publishers in AC table
  • trigger AC
  • when AC is in process (you can see it in logs)
  • turn AC off and close browser
  • restart browser and make sure that contribution is marked as failed on internals page

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@NejcZdovc NejcZdovc added this to the 1.12.x - Nightly milestone Jun 18, 2020
@NejcZdovc NejcZdovc requested a review from a team June 18, 2020 15:06
@NejcZdovc NejcZdovc self-assigned this Jun 18, 2020
@NejcZdovc NejcZdovc requested review from emerick and zenparsing and removed request for a team June 18, 2020 15:06
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jun 30, 2020

Verification passed on


Brave | 1.12.60 Chromium: 83.0.4103.116 (Official Build) nightly (64-bit)
-- | --
Revision | 8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}
OS | Windows 10 OS Version 1903 (Build 18362.900)

Scenario 1: (AC with only verified pubs added in AC table)

  • Launched browser using staging flag brave.exe --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 , Added 4 verified pubs into AC table and Triggered a AC.
  • Turned OFF the AC switch and then closed the browser when the following logs appeared in the console
[9452:18780:0630/123845.779:VERBOSE1:contribution.cc(167)] Staring monthly contribution
[9452:18780:0630/123845.779:VERBOSE1:contribution.cc(264)] Timer will start in 1
[9452:18780:0630/123845.794:VERBOSE1:contribution_ac.cc(33)] Starting auto contribution
  • When the browser is restarted following logs are recorded in logs in the console
[16592:1908:0630/125633.967:VERBOSE1:contribution.cc(775)] AC is disabled, completing contribution

  • Navigate to Contributions page in the brave://rewards-internals, the Step is recorded as Auto-contribute was turned off and the contributed amount is displayed as zero for pubs for which AC has not happened (Note: By the time I turn off the AC switch, AC happened for one of the sites hence the Contributed amount: 5.75 BAT is recorded for 3zsistemi.si which is correct confirmed with @NejcZdovc )
    image
  • Verified that contributed_amount is displayed as zero for the publishers for which AC has not happened

image

  • Verified that redemed_at TS should be zero for the publishers for which the AC has not happened ( Note: In my case, AC has happened for 3zsistemi.si (5.57 BAT---> 23 unblinded token are recoded with time stamp 23*0.25 = 5.57 which is correct)
    image

Scenario 2: (AC for verified pubs added in AC table + recurring tips setup for verified pubs)

  • Verified that when AC is turned OFF, recurring tips are processed as usual.
  • Verified that DB values are displayed as expected in contribution_info_publishers, Contribution_info and unblinded_tokens tables
    image

Verified using

Brave	1.12.61 Chromium: 83.0.4103.116 (Official Build) nightly (64-bit)
Revision	8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}
OS	macOS Version 10.14.6 (Build 18G3020)

Scenario 1 - PASSED (see note below for follow up issue information)

Scenario 1 - UGP

Scenario 2: PASSED

  • Verified test plan from description when wallet was funded via KYC'd user wallet. Confirmed brave://rewards-internals displayed as expected. Confirmed DB displayed as expected on contribution_info_publishers and unblinded_tokens.
  • After running this scenario, attempted to tip, no issues tipping KYC'd publisher as tips are p2p.
  • Note, full monthly budget was deducted from balance, this is expected per discussions: https://bravesoftware.slack.com/archives/CB0KCRCQN/p1593520104213200?thread_ts=1593519527.212600&cid=CB0KCRCQN and occurs when wallet is a restored anon wallet as well.

Scenario 3: PASSED (see note below for follow up issue information)

Scenario 4: PASSED

  • generally re-run original scenario but add recurring tips. So sample steps would be:
  1. Clean profile, enable rewards (set monthly budget to 10 BAT)
  2. Claim UGP grant
  3. Add verified pubs to AC table (4+)
  4. Set up 3+ recurring tips
  5. Wait for AC to start
  6. Once AC is in process, toggle it off
  7. Close/Restart browser.
    --> After relaunching, confirmed recurring tips continued to process but AC did not (saw AC is disabled, completing contribution in the logs).

Scenario 4 - UGP

Scenario 5: PASSED

  • Same steps as scenario 4, but fund wallet via KYC'd Uphold account instead of UGP grant in step 2
    --> After relaunching, confirmed recurring tips continued to process but AC did not (saw AC is disabled, completing contribution in the logs).

Scenario 6: PASSED

  • Same steps as scenario 4, but restore an anon user wallet instead of claiming UGP grant in step 2
    --> After relaunching, confirmed recurring tips continued to process but AC did not (saw AC is disabled, completing contribution in the logs).

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

Successfully merging this pull request may close these issues.

[Desktop] Stop retries if auto contribute or Rewards setting is off
3 participants