question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make tipping banner response depend on success/error from server: Follow up to 15543

See original GitHub issue

Description

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)

  1. Clean profile, staging env
  2. Enable Rewards, claim UGP grant
  3. Go to tip a verified publisher
  4. Watch logs
  5. 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)

  1. Clean profile, staging env
  2. Enable Rewards, connect KYC’d Uphold staging wallet
  3. Go to tip an Uphold verified publisher
  4. Watch logs
  5. 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:

cc @szilardszaloki @Miyayes

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Miyayescommented, Oct 29, 2021

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.

0reactions
GeetaSarvadnyacommented, Aug 25, 2022

Verification PASSED on

Brave | 1.43.78 Chromium: 104.0.5112.102 (Official Build) beta (64-bit)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | Windows 10 Version 21H2 (Build 19044.1889)

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.

image

Logs:

[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards/4f157868-e243-4eab-bbea-e10318a3b971/transactions
> Method: POST
> Content: {"denomination":{"amount":"0.950000","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c","message":""}
> Content Type: application/json; charset=utf-8
[18924:3804:0825/162553.057:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards/4f157868-e243-4eab-bbea-e10318a3b971/transactions
> Result: Failure
> HTTP Code: 500
> Body: {"application":{"clientId":"4c2b665ca06.....}
[18924:3804:0825/162553.057:VERBOSE9:logging_util.cc(138)]
[ RESPONSE HEADERS ]
> Url: https://api-sandbox.uphold.com/v0/me/cards/4f157868-e243-4eab-bbea-e10318a3b971/transactions

[18924:3804:0825/162553.062:INFO:post_transaction.cc(63)] Unexpected HTTP status: 500
[18924:3804:0825/162553.086:VERBOSE5:ledger_impl.cc(117)]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduce "You've set up a pending tip" messaging for ... - GitHub
LaurenWags mentioned this issue on Aug 10. Make tipping banner response depend on success/error from server: Follow up to 15543 #19071.
Read more >
How Restaurant Servers Increased Tips by 23 Percent ...
One of the most critical periods of the process is the follow-up after purchase: making your customer feel like they've made the right ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found