brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.83k stars 2.33k forks source link

Rewards is hardcoded to use the `Brave Browser` card in Uphold #16899

Open bsclifton opened 3 years ago

bsclifton commented 3 years ago

Description

The main symptom for this issue will be the user noticing that the balance is showing as 0. When user logs into Uphold, the funds are there - but they're on a different card.

Steps to Reproduce

  1. Have an Uphold account with balance, connect it, move all the balance over to Brave Browser wallet. Verify balance shows in brave://rewards image
  2. Login to Uphold (or in Brave, use the connect button and pick Go to my Uphold account) image
  3. Inside Uphold, rename the Brave Browser card. I chose to rename as Browser image
  4. Disconnect the wallet (in Brave) and reconnect

Actual result:

Balance shows 0 😱 image

If you go into Uphold, you'll notice it made a new empty card: image

Expected result:

Code should be smart enough to find a wallet with balance; or prompt user for which one to use?

Reproduces how often:

100%

bsclifton commented 3 years ago

Also noteworthy: you can have two cards with the same name (ex: two cards named Brave Browser) in Uphold

Per @szilardszaloki:

So first we try to retrieve a list of BAT cards and take the first one with the Brave Browser label. If you don't have one, we create one for you with "label": "Brave Browser" and "currency": "BAT". Then we set the newly created card's "position" to 1 and set it to "starred".