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

Fixes estimated Pending Rewards value decreased unexpectedly - follow up to #16678 #9418

Merged
merged 1 commit into from Jul 15, 2021

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Jul 13, 2021

Resolves brave/brave-browser#16861

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
  • 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:

@LaurenWags to confirm fixes balance for her broken profile

Copy link
Collaborator

@kylehickinson kylehickinson left a comment

Choose a reason for hiding this comment

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

iOS ++

@tmancey tmancey force-pushed the issues/16861 branch 6 times, most recently from c50143e to c40644b Compare July 13, 2021 19:20
@tmancey tmancey requested a review from a team as a code owner July 13, 2021 19:20
@tmancey tmancey force-pushed the issues/16861 branch 2 times, most recently from 16f55b9 to 008d33e Compare July 13, 2021 19:32
Copy link
Collaborator

@zenparsing zenparsing left a comment

Choose a reason for hiding this comment

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

Rewards changes look good.

@tmancey tmancey force-pushed the issues/16861 branch 5 times, most recently from 5f63f4b to 6df0d1d Compare July 14, 2021 13:31
@LaurenWags
Copy link
Member

LaurenWags commented Jul 16, 2021

Verified using below:

Brave | 1.29.5 Chromium: 92.0.4515.101 (Official Build) nightly (x86_64)
-- | --
Revision | edb73f4fb624e2ea0cb6f5cc39c9e317ecd3535b-refs/branch-heads/4515@{#1536}
OS | macOS Version 10.15.7 (Build 19H1217)
Scenario 1 - Personal Profile
  1. Used my broken profile (on 1.28.84) and confirmed that I had 4 unredeemed (not cashed in with the server) unblinded payment tokens each worth 0.01 BAT in confirmations.json.
  2. Noted the OnGetPayments response for current month from the server which is {"month":"2021-07","transactionCount":"83","balance":"0.97"}.
  3. Confirmed my Ads panel on brave://rewards did not display as expected:
1 28 x
  1. Took a copy of this profile and launched with Nightly version above
  2. Confirmed the OnGetPayments response for current month from the server is still {"month":"2021-07","transactionCount":"83","balance":"0.97"}.
  3. Confirmed my Ads panel on brave://rewards now displays as expected. It shows my Estimated BAT as the server value (0.97 BAT) + my unredeemed BAT (0.04 BAT) for a total of 1.01 BAT.
1 29 x

However, my ad transaction count is not correctly reflecting the ads viewed that have not been redeemed. Server response says 83 which is what is reflected in the UI, I would expect it to be 87 (server value + ads viewed but not cashed in w/ the server). Discussed this with @tmancey and this might not be a bug, I just might have gotten myself into a bad state for this month. He is going to investigate but I have logged brave/brave-browser#17006 in case this does turn out to be a bug.

Brave | 1.29.8 Chromium: 92.0.4515.101 (Official Build) nightly (x86_64)
-- | --
Revision | edb73f4fb624e2ea0cb6f5cc39c9e317ecd3535b-refs/branch-heads/4515@{#1536}
OS | macOS Version 10.15.7 (Build 19H1217)
Scenario 2-Cursory checks
  1. Clean 1.29.x Nightly profile
  2. Enable Rewards
  3. View some ads - Confirm UI is as expected
Ads Panel NTP Widget
step3-panel step3-widget
  1. Cash them in with the server - Confirm UI is still as expected

Server logs:

[60163:775:0719/091658.691312:VERBOSE1:redeem_unblinded_payment_tokens.cc(79)] RedeemUnblindedPaymentTokens
[60163:775:0719/091658.691446:VERBOSE2:redeem_unblinded_payment_tokens.cc(88)] PUT /v1/confirmation/payment/{payment_id}
[60163:775:0719/091658.691518:VERBOSE5:redeem_unblinded_payment_tokens.cc(98)] URL Request:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0.........
  Content: {"payload":"{\"paymentId\":\"0...........
  Content Type: application/json
  Method: PUT
[60163:775:0719/091658.841212:VERBOSE1:redeem_unblinded_payment_tokens.cc(109)] OnRedeemUnblindedPaymentTokens
[60163:775:0719/091658.841318:VERBOSE6:redeem_unblinded_payment_tokens.cc(111)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0..........
  Response Status Code: 200
  Response: {"status":"ok"}
[60163:775:0719/091658.841992:VERBOSE1:account.cc(195)] Successfully redeemed unblinded payment tokens
[60163:775:0719/091658.842353:VERBOSE1:ad_rewards.cc(205)] Reconcile ad rewards
[60163:775:0719/091658.842435:VERBOSE1:ad_rewards.cc(213)] GetPayments
[60163:775:0719/091658.842492:VERBOSE2:ad_rewards.cc(214)] GET /v1/confirmation/payment/{payment_id}
[60163:775:0719/091658.844335:VERBOSE5:ad_rewards.cc(218)] URL Request:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0.........
  Method: GET
[60163:775:0719/091658.845104:VERBOSE1:redeem_unblinded_payment_tokens.cc(71)] Redeem unblinded payment tokens in 0 hours, 3 minutes, 23 seconds at 9:20 AM
[60163:775:0719/091658.982382:VERBOSE1:ad_rewards.cc(227)] OnGetPayments
[60163:775:0719/091658.982483:VERBOSE6:ad_rewards.cc(229)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0............
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"3","balance":"0.03"}]
[60163:775:0719/091658.983508:VERBOSE1:ad_rewards.cc(250)] Successfully reconciled ad rewards
Ads Panel NTP Widget
step4-panel step4-widget
  1. View more ads - Confirm UI is still as expected
Ads Panel NTP Widget
step5-panel step5-widget
  1. Cash them in with the server - Confirm UI is still as expected

Server logs:

[60163:775:0719/092021.846841:VERBOSE1:redeem_unblinded_payment_tokens.cc(79)] RedeemUnblindedPaymentTokens
[60163:775:0719/092021.847031:VERBOSE2:redeem_unblinded_payment_tokens.cc(88)] PUT /v1/confirmation/payment/{payment_id}
[60163:775:0719/092021.847131:VERBOSE5:redeem_unblinded_payment_tokens.cc(98)] URL Request:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0.........
  Content: {"payload":"{\"paymentId\":\"0........
  Content Type: application/json
  Method: PUT
[60163:775:0719/092021.975690:VERBOSE1:redeem_unblinded_payment_tokens.cc(109)] OnRedeemUnblindedPaymentTokens
[60163:775:0719/092021.975797:VERBOSE6:redeem_unblinded_payment_tokens.cc(111)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0..........
  Response Status Code: 200
  Response: {"status":"ok"}
[60163:775:0719/092021.976473:VERBOSE1:account.cc(195)] Successfully redeemed unblinded payment tokens
[60163:775:0719/092021.976881:VERBOSE1:ad_rewards.cc(205)] Reconcile ad rewards
[60163:775:0719/092021.976964:VERBOSE1:ad_rewards.cc(213)] GetPayments
[60163:775:0719/092021.977018:VERBOSE2:ad_rewards.cc(214)] GET /v1/confirmation/payment/{payment_id}
[60163:775:0719/092021.978684:VERBOSE5:ad_rewards.cc(218)] URL Request:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0.........
  Method: GET
[60163:775:0719/092021.979449:VERBOSE1:redeem_unblinded_payment_tokens.cc(71)] Redeem unblinded payment tokens in 0 hours, 48 minutes, 36 seconds at 10:08 AM
[60163:775:0719/092022.107619:VERBOSE1:ad_rewards.cc(227)] OnGetPayments
[60163:775:0719/092022.107710:VERBOSE6:ad_rewards.cc(229)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/0.........
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"6","balance":"0.06"}]
[60163:775:0719/092022.108850:VERBOSE1:ad_rewards.cc(250)] Successfully reconciled ad rewards
Ads Panel NTP Widget
step6-panel step6-widget
  1. Restart browser
  2. Confirm UI is as expected
Ads Panel NTP Widget
step7-panel step7-widget
  1. View another ad - Confirm UI is still as expected
Ads Panel NTP Widget
step9-panel step9-widget

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