Make tipping banner response depend on success/error from server: Follow up to 15543
See original GitHub issueDescription
Update Oct 29, 2021: Upon further testing and investigation, original #15543 was not resolved by changes there. Much deeper changes to the contribution engine will be needed to successfully resolve #15543. I have updated title of this issue to become the new #15543.
@szilardszaloki found this issue while discussing https://github.com/brave/brave-browser/issues/15543
Due to a long existing but, anon or Uphold user wallets will always show “Success” (confetti) after tipping. They do not show the “Failure” state. From @szilardszaloki:
Just found a bug deep down in the contribution code (which has been around since June 2020). ContributionTip
doesn’t pass down the callback to the layer that actually handles the processing of contributions, but instead returns with LEDGER_OK
when saving the contribution queue in the contribution_queue
table (no matter if it was successful or not).
Steps to Reproduce
Case 1 - Anon wallet (pre-req: have Charles Proxy set up to return 500 error for https://grant.rewards.bravesoftware.com/v1/suggestions
)
- Clean profile, staging env
- Enable Rewards, claim UGP grant
- Go to tip a verified publisher
- Watch logs
- You will see the 500 error, but you get the success/confetti on tip banner
Case 2 - Uphold wallet (pre-req: have Charles Proxy set up to return 500 error for https://api-sandbox.uphold.com/v0/me/cards/card-id/transactions
)
- Clean profile, staging env
- Enable Rewards, connect KYC’d Uphold staging wallet
- Go to tip an Uphold verified publisher
- Watch logs
- You will see the 500 error, but you get the success/confetti on tip banner
All tipping scenarios for all wallet types (including bitFlyer and Gemini) would need to be retested once this is resolved.
Actual result:
Success on tip banner
Expected result:
Failure on tip banner
Reproduces how often:
easily
Brave version (brave://version info)
Brave | 1.32.84 Chromium: 95.0.4638.54 (Official Build) beta (x86_64)
-- | --
Revision | d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}
OS | macOS Version 11.6 (Build 20G165)
Version/Channel Information:
- Can you reproduce this issue with the current release? n/a
- Can you reproduce this issue with the beta channel? yes
- Can you reproduce this issue with the nightly channel? yes
Other Additional Information:
- Does the issue resolve itself when disabling Brave Shields?
- Does the issue resolve itself when disabling Brave Rewards?
- Is the issue reproducible on the latest version of Chrome?
Miscellaneous Information:
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Update Oct 29, 2021: Upon further testing and investigation, original #15543 was not resolved by changes there. Much deeper changes to the contribution engine will be needed to successfully resolve #15543. I have updated title of this issue to become the new #15543.
Verification PASSED on
Uphold failed tip - PASSED
Verified STR from Case 2 in https://github.com/brave/brave-browser/issues/19071#issue-1038733795.
Confirmed when https://api-sandbox.uphold.com/v0/me/cards/card-id/transactions returns 500, the tip banner reflects that there is a failed tip.
Logs: