-
Notifications
You must be signed in to change notification settings - Fork 862
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
Add support for BAP reporting endpoint #8054
Conversation
b51cc70
to
6793ab9
Compare
6793ab9
to
4bd33b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just had a minor nit.
vendor/bat-native-ledger/src/bat/ledger/internal/promotion/bap_reporter.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/promotion/bap_reporter_endpoint.cc
Show resolved
Hide resolved
4bd33b9
to
5326c21
Compare
CI post-init failed on unrelated |
Verified using
Test Case 1 - non JP RegionPre-req, be set up for non JP region. I am using US.
Test Case 2 - Happy Path, JP RegionPre-req for this case and all others unless otherwise noted is to have region = Japan
Test Case 3 - Tip before BAP is reported
Test Case 4 - Server returns 400, reporting goes into retries
Note - geometric timer w/ randomness is used so I am unable to confirm that it backs off exactly as listed in https://bravesoftware.slack.com/archives/CB0KCRCQN/p1614191899060000?thread_ts=1614111570.049100&cid=CB0KCRCQN, but I did confirm with @zenparsing that it looked correct Test Case 5 - Server returns 500, reporting goes into retries
See note about geometric timer/randomness used under TC 4. Test Case 6 - wifi is off, reporting goes into retries
See note about geometric timer/randomness used under TC 4. Test Case 7 - Promotions disabled after BAP successfully reported
Test Case 8 - Server returns 409, reporting does not retry
Test Case 9 - Upgrade w/ single grant claimed
Test Case 10 - Upgrade with more than one grant claimed
Test Case 11 - Upgrade w/ 0 BAP balance
Test Case 12 - recheck https://github.com//pull/7698Verified items from #7698 (comment) Scenario 1 - Non JP Region Confirmed able to claim promotion
Scenario 2 - JP Region Confirmed when BAP balance is 0, there is no popup/alert on NTP
Confirmed BAP alert remains on NTP until it is acknowledged (clicking on OK or "x"). Scenario 3 - Promotion fetching JP Region - Confirmed on a clean profile, promotions not fetched when date is 2021-03-13
US Region - Confirmed on a clean profile, promotions are fetched when date is 2021-03-13
|
Resolves brave/brave-browser#14315
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Non-JP regions
There are no behavioral changes for profiles with their region not set to JP.
brave://rewards-internals
and view the logs./v1/promotions/report-bap
.JP regions
For JP-region profiles, a network request is made to report the user's current virtual token amount. The request is only made if the balance is greater than zero and it is only made once.
brave://rewards-internals
and view the logs.bap_reporter.cc
indicating that the user has zero tokens and a retry has been scheduled.brave://rewards-internals
and view the logs./v1/promotions/report-bap
.brave://rewards-internals
and view the logs./v1/promotions/report-bap
.