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

Estimated pending rewards should reset monthly #15005

Closed
Miyayes opened this issue Mar 29, 2021 · 13 comments · Fixed by brave/brave-core#8852
Closed

Estimated pending rewards should reset monthly #15005

Miyayes opened this issue Mar 29, 2021 · 13 comments · Fixed by brave/brave-core#8852
Assignees
Labels
design A design change, especially one which needs input from the design team feature/ads feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android ARM QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Yes release-notes/include rewards-2.0

Comments

@Miyayes
Copy link
Collaborator

Miyayes commented Mar 29, 2021

Description

Right now, the estimated pending rewards counter in brave://rewards captures the cumulative total and does not reset every single month. Currently, it only decrements when the BAT is paid out or claimed.

The design team would like the estimated ad earnings counter to appear as follows:

  1. Monthly reset: Estimated pending rewards counter should show the estimated ad earnings for this calendar month only

  2. Arrival notice: Since there is a delay between when the user receives their payout and the beginning of the calendar month (since payout day is on the 5th), then from the 1st to the 5th of the month, there should be a countdown that says "Your x BAT is on the way and will be here in n days" (not final text).

In the Ads module in brave://rewards, it should be redesigned and broken out by calendar month as so:

image


This will bring the behavior more in line with the upcoming Brave Rewards dropdown panel refresh, as well as the Brave Rewards NTP widget.

@Miyayes Miyayes added design A design change, especially one which needs input from the design team design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. OS/Android Fixes related to Android browser functionality OS/Desktop labels Mar 29, 2021
@Miyayes
Copy link
Collaborator Author

Miyayes commented Mar 31, 2021

@jsecretan for review of above.

@jsecretan
Copy link

Yep, all good by me, the vital part is highlighting the estimated amount on the way, because when we had left that out in early versions, users were very unhappy. Eager to see the design treatment of that.

@jsecretan
Copy link

I should mention, there is some complexity here though. I do believe we'll be able to pretty closely estimate the payout, by knowing when the payment tokens were checked in (but cc: @tmancey to keep me honest). However, there are frequently amounts you earned in a month that will "rollover" to the next month, based on how the protocol works. It would be best if the design treatment had some way of dealing with this.

@Miyayes Miyayes removed the design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. label Apr 8, 2021
@tmancey
Copy link
Contributor

tmancey commented Apr 9, 2021

@jsecretan We can infer the exact amount due from the payment balance endpoint for the previous month

@tmancey tmancey added OS/iOS Fixes related to iOS browser functionality and removed feature/rewards labels Apr 9, 2021
@jsecretan
Copy link

Great, thanks @tmancey

@Miyayes
Copy link
Collaborator Author

Miyayes commented Apr 28, 2021

Clarification

Current behavior: Let's say that a browser has "10 BAT estimated pending rewards this month". In reality, due to the protocol, the user will probably only receive 9 BAT in the upcoming payment date. 1 BAT will be rolled over to the next month's estimated pending rewards.

How it should work with the new changes

Given the above example with:

  • 10 BAT pending
  • 9 to be actually paid out
  • 1 leftover

Once the new month comes:

  1. The browser should say "9 BAT arriving in 4 days" (the value of 9 BAT is knowable by the browser, per @jsecretan)
  2. The 1 BAT leftover will just be rolled over to the "current earnings this month"

@bsclifton bsclifton added the priority/P2 A bad problem. We might uplift this to the next planned release. label May 10, 2021
@zenparsing
Copy link

The NTP rewards widget should be updated to show the same information (including the "X BAT arriving in Y days" notice).

@zenparsing zenparsing self-assigned this May 14, 2021
@zenparsing zenparsing added this to the 1.27.x - Nightly milestone Jun 4, 2021
@zenparsing zenparsing added QA/Yes release-notes/include and removed OS/Android Fixes related to Android browser functionality OS/iOS Fixes related to iOS browser functionality labels Jun 4, 2021
@LaurenWags
Copy link
Member

Labelling as QA/Blocked for now, additional information is needed for the test plan as discussed in last week's Rewards meeting with @zenparsing.

@srirambv srirambv added the OS/Android Fixes related to Android browser functionality label Jun 25, 2021
@LaurenWags LaurenWags added QA/In-Progress Indicates that QA is currently in progress for that particular issue and removed QA/Blocked labels Jun 28, 2021
@LaurenWags
Copy link
Member

LaurenWags commented Jul 1, 2021

Verification completed with

Brave	1.27.87 Chromium: 91.0.4472.124 (Official Build) beta (x86_64)
Revision	7345a6d1bfcaff81162a957e9b7d52649fe2ac38-refs/branch-heads/4472_114@{#6}
OS	macOS Version 10.15.7 (Build 19H1217)

Encountered and logged #16731 while testing this issue.

Scenario 1 - not all tokens from June cashed in prior to Jul 1 (some token roll-over) - Production
  • Confirmed starting July 1 the new UI showed as expected on brave://rewards ad panel and NTP widget.
  • Confirmed new UI showed expected ad grant amount per the cashed in tokens from the logs.
  • Confirmed that uncashed in tokens from June rolled over to July and are reflected in the "Current earnings this month (estimated)" value.
  • Confirmed able to view ads and "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.
  • Confirmed that the balance values for June match each other as well the amount of the expected ad grant.
  • Confirmed that the number of days shown on UI decreases each day as it gets closer to the expected ad grant date.

June 30th OnGetPayments result:

[15518:775:0630/142335.644018:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[15518:775:0630/142335.644102:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/7............
  Response Status Code: 200
  Response: [{"month":"2021-06","transactionCount":"34","balance":"0.2725"}]

July 1st OnGetPayments result:

[17727:775:0701/080739.643931:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[17727:775:0701/080739.644033:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/7........
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"2","balance":"0.02"},{"month":"2021-06","transactionCount":"34","balance":"0.2725"}]
June 30th July 1st July 2nd
Jun30-15005 prod env profile1 ad panel Jul1-15005 prod env profile1 ad panel Jul2-15005 prod env profile1 ad panel
Jun30-15005 prod env profile1 NTP widget Jul1-15005 prod env profile1 NTP widget Jul2-15005 prod env profile1 NTP widget

During testing, the Ad grant date was changed from July 5 --> July 7 using Griffin.
Confirmed the new UI updated to reflect this change.

Ad panel NTP Widget
Jul7-15005 prod env profile1 ad panel Jul7-15005 prod env profile1 NTP widget

Confirmed that July 7 showed the new UI, but July 8 did not.
Confirmed when claiming the ad grant on July 8 the "Current earnings this month (estimated)" did not decrease by amount of ad grant.
Confirmed able to restart and view an ad and the "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.

July 8 before claiming ad grant July 8 after claiming ad grant July 8 restart and view ad
profile1 before claim ad grant profile1 after claim ad grant profile1 restart and view ad
Scenario 2 - all tokens from June cashed in prior to Jul 1 (no token roll-over) - Production
  • Confirmed starting July 1 the new UI showed as expected on brave://rewards ad panel and NTP widget.
  • Confirmed new UI showed expected ad grant amount per the cashed in tokens from the logs.
  • Confirmed that the balance values for June match each other as well the amount of the expected ad grant.
  • Confirmed able to view ads in the new month and "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.
  • Confirmed that the number of days shown on UI decreases each day as it gets closer to the expected ad grant date.

June 30th OnGetPayments result:

[15656:775:0630/142932.484251:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[15656:775:0630/142932.484350:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/2.........
  Response Status Code: 200
  Response: [{"month":"2021-06","transactionCount":"18","balance":"0.145"}]

July 1st OnGetPayments result:

[18180:775:0701/100351.034554:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[18180:775:0701/100351.034588:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/2.........
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-07","transactionCount":"0"},{"month":"2021-06","transactionCount":"18","balance":"0.145"}]
June 30th July 1st July 2nd
Jun30-15005 prod env profile2 ad panel Jul1-15005 prod env profile2 ad panel Jul2-15005 prod env profile2 ad panel
Jun30-15005 prod env profile2 NTP widget Jul1-15005 prod env profile2 NTP widget Jul2-15005 prod env profile2 NTP widget

During testing, the Ad grant date was changed from July 5 --> July 7 using Griffin.
Confirmed the new UI updated to reflect this change.

Ad panel NTP Widget
Jul7-15005 prod env profile2 ad panel Jul7-15005 prod env profile2 NTP widget

Confirmed that July 7 showed the new UI, but July 8 did not.
Confirmed when claiming the ad grant on July 8 the "Current earnings this month (estimated)" did not decrease by amount of ad grant.
Confirmed able to view an ad and restart and the "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.

July 8 before claiming ad grant July 8 after claiming ad grant July 8 view ad and restart
profile2 before claim ad grant profile2 after claim ad grant profile2 view ad and restart
Scenario 3 - no tokens cashed in for June (clean profile) - Production

Created a profile today (July 1) and viewed some ads.
Confirmed those ad tokens were cashed in with the server.
Confirmed no "BAT arriving in X days" message on ad panel or NTP widget as expected (since no ad grant will be issued for previous month of June).

July 1st OnGetPayments result before cashing tokens in with the server

[19682:775:0701/123702.572936:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[19682:775:0701/123702.572960:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/e.........
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-07","transactionCount":"0"}]

July 1st OnGetPayments result after cashing tokens in with the server

[19815:775:0701/131413.602374:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[19815:775:0701/131413.602420:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/e............
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"5","balance":"0.05"}]
Example Example
clean ad panel clean NTP widget
Scenario 4 - Next payment date is not the 5th

Using Griffin, the next ad payment date can be changed to be something other than the 5th. Using staging variations server, confirmed that if the "Next payment date" is set to be something other than the standard 5th, the new UI message recognizes this and adjusts accordingly.

staging variations
Translations

Spot checked to confirm translations. Used the following languages

German French Japanese
German1 French1 J1
German2 French2 J2

Verification completed with

Brave	1.27.82 Chromium: 91.0.4472.120 (Official Build) beta (64-bit)
Revision	12c5925972cffe578ca7ca7a295e98ee7e178a7a-refs/branch-heads/4472@{#1506}
OS	Linux
Scenario 1 - not all tokens from June cashed in prior to Jul 1 (some token roll-over) - Staging
  • Confirmed starting July 1 the new UI showed as expected on brave://rewards ad panel and NTP widget.
  • Confirmed new UI showed expected ad grant amount per the cashed in tokens from the logs.
  • Confirmed that uncashed in tokens from June rolled over to July and are reflected in the "Current earnings this month (estimated)" value.
  • Confirmed able to view ads and "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.
  • Confirmed that the balance values for June match each other as well the amount of the expected ad grant.
  • Confirmed that the number of days shown on UI decreases each day as it gets closer to the expected ad grant date.

June 30th OnGetPayments result:

[3070:3070:0630/143722.163034:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[3070:3070:0630/143722.163279:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/d......
  Response Status Code: 200
  Response: [{"month":"2021-06","transactionCount":"2","balance":"0.02"}]

July 1st OnGetPayments result:

[3063:3063:0701/074901.238404:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[3063:3063:0701/074901.238637:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/d.......
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"1","balance":"0.3"},{"month":"2021-06","transactionCount":"2","balance":"0.02"}]
June 30th July 1st July 2nd
Jun30-15005 staging env profile1 ads panel Jul1-15005 staging env profile1 ad panel Jul2-15005 staging env profile1 ad panel
Jun30-15005 staging env profile1 NTP widget Jul1-15005 staging env profile1 NTP widget Jul2-15005 staging env profile1 NTP widget
Scenario 2 - all tokens from June cashed in prior to Jul 1 (no token roll-over) - Staging
  • Confirmed starting July 1 the new UI showed as expected on brave://rewards ad panel and NTP widget.
  • Confirmed new UI showed expected ad grant amount per the cashed in tokens from the logs.
  • Confirmed that the balance values for June match each other as well the amount of the expected ad grant.
  • Confirmed able to view ads in the new month and "Current earnings this month (estimated)" + "Ads received this month" both increment as expected.
  • Confirmed that the number of days shown on UI decreases each day as it gets closer to the expected ad grant date.

June 30th OnGetPayments result:

[3801:3801:0630/144157.886428:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[3801:3801:0630/144157.886732:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/f......
  Response Status Code: 200
  Response: [{"month":"2021-06","transactionCount":"3","balance":"0.07"}]

July 1st OnGetPayments result:

[3810:3810:0701/075429.225191:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[3810:3810:0701/075429.225268:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/f........
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-07","transactionCount":"0"},{"month":"2021-06","transactionCount":"3","balance":"0.07"}]
June 30th July 1st July 2nd
Jun30-15005 staging env profile2 ads panel Jul1-15005 staging env profile2 ad panel Jul2-15005 staging env profile2 ad panel
Jun30-15005 staging env profile2 NTP widget Jul1-15005 staging env profile2 NTP widget Jul2-15005 staging env profile2 NTP widget

Verification passed on

Brave | 1.27.106 Chromium: 92.0.4515.101 (Official Build) (64-bit)
-- | --
Revision | edb73f4fb624e2ea0cb6f5cc39c9e317ecd3535b-refs/branch-heads/4515@{#1536}
OS | Windows 10 OS Version 2004 (Build 19041.1083)

  • Used Charles proxy rewrite rule and tested the issue in staging environment
Set the system date to `31st July`, launch brave with clean profile and enable rewards

Confirmed Current earnings this month (estimated) is shown as 0.210 BAT (which is configured in Charles)
image

Set the system date to `1st Aug` and relaunch brave

Confirmed starting Aug 1st the new UI showed as expected on brave://rewards
image

Confirmed starting Aug 1st the new UI showed as expected in NTP also
image

Set the system date to `5th Aug` and relaunch brave

Confirmed ads payout alert is shown as expected on brave://rewards
image

Confirmed ads payout alert is shown as expected in NTP
image

Set the system date to `7th Aug` and relaunch brave

Confirmed ads payout alert is shown as expected on brave://rewards
image

Confirmed ads payout alert is shown as expected in NTP
image

Set the system date to `8th Aug` and relaunch brave

Confirmed ads payout alert is NOT shown in brave://rewards on 8th Aug
image

Confirmed ads payout alert is NOT shown in NTP on 8th Aug
image

Set the system date to `9th Aug` and relaunch brave

Confirmed ads payout alert is NOT shown in brave://rewards on 9th Aug
image

Confirmed ads payout alert is NOT shown in NTP on 9th Aug
image

no ads payout alert on July20th (clean profile) - Production

Created a profile today (July 20th) and viewed some ads.
Confirmed those ad tokens were cashed in with the server.
Confirmed no "BAT arriving in X days" message on ad panel or NTP widget as expected (since no ad grant will be issued in the mid of the month)

[14860:3664:0720/130441.623:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[14860:3664:0720/130441.623:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/8d1447b5-ae16-41b9-9f3b-abe3d8b583c3
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-07","transactionCount":"0"}]
[14860:3664:0720/130601.773:VERBOSE1:ad_rewards.cc(268)] OnGetPayments
[14860:3664:0720/130601.773:VERBOSE6:ad_rewards.cc(270)] URL Response:
  URL: https://ads-serve.brave.com/v1/confirmation/payment/8d1447b5-ae16-41b9-9f3b-abe3d8b583c3
  Response Status Code: 200
  Response: [{"month":"2021-07","transactionCount":"1","balance":"0.01"}]
Next payment date is not the 5th

Using Griffin, the next ad payment date can be changed to be something other than the 5th. Using staging variations server, confirmed that if the "Next payment date" is set to be something other than the standard 5th, the new UI message recognizes this and adjusts accordingly. Currently Ads panel is showing up the next payment date as 6th Aug or some other date on a clean install, restart browser is required to see the correct next payment date which is the expected behavior (next payment date is set to 8th in Griffin). Discussed with @tmancey ( encountered and closed #16858 (comment)
Before browser restart
image

After browser restart
image

Translations

Verified the ads payout alert message in Kannada and Hindi locales and confirmed payout alert notification is translated in both ads panel and NTP widget

Kannada

Ads panel NTP widget
image image

Hindi

Ads panel NTP widget
image image

@jonathansampson
Copy link
Contributor

"Arriving in x days" refers to the start of the payout process, and not necessarily when the user will receive their rewards. For some, it may be x days. For others, it may be x + 1 days. Correct?

@tmancey
Copy link
Contributor

tmancey commented Jul 1, 2021

@jonathansampson that is correct

@jonathansampson
Copy link
Contributor

Thank you for confirming, @tmancey. We should then expect to receive routine feedback from users who fall into the x + y days category, given the current wording.

@LaurenWags LaurenWags added QA Pass-Linux QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Jul 6, 2021
@srirambv
Copy link
Contributor

srirambv commented Jul 14, 2021

Verification passed on OnePlus 6T with Android 10 running 1.27.100

  • Verified starting July 1 the new UI showed as expected on brave://rewards

  • Verified new UI showed expected ad grant amount per the cashed in tokens from the logs.

  • Verified that uncashed in tokens from June rolled over to July and are reflected in the "Current earnings this month (estimated)" value

  • Verified able to view ads and "Current earnings this month (estimated)" + "Ads received this month" both increment as expected

  • Verified that the balance values for June match each other as well the amount of the expected ad grant

  • Verified that the number of days shown on UI decreases each day as it gets closer to the expected ad grant date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design A design change, especially one which needs input from the design team feature/ads feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android ARM QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Yes release-notes/include rewards-2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants