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

(Ledger client) Capture more details when linking anonymous wallet to custodian #15257

Closed
bsclifton opened this issue Apr 13, 2021 · 4 comments
Closed
Assignees
Labels
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.

Comments

@bsclifton
Copy link
Member

Description

Overview of process

  1. Person has Brave Rewards enabled
  2. Uphold account is setup and verified
  3. Person clicks the Verify Wallet button on brave://rewards
  4. Login is made via Uphold (and when available, other custodian)
  5. Backend calls are made; goal is to move funds from anonymous wallet to custodian (ex: Uphold)

Problem

The problem is that sometimes folks are getting stuck and need to reach out to @brave/rewards-support to provide more information to help get unstuck. This is a bad experience and requires a lot of manual intervention

What happens in the code

When a person w/ Brave Rewards enabled connects their wallet to Uphold for the first time, a few things will happen:

  1. Check is made to make sure Uphold account is verified (click here for code)
  2. If verified, a call is made to our backend to start the "claim". This will link the account (click here for code)
  3. If claim call is successful, the transfer tokens call is made (click here for code)

Problems / what could be better

We throw away most of the response in steps 2 and 3 above (claim / transfer tokens). This could be extremely useful in debugging and could be logged to brave://rewards-internals or saved to profile

  1. For Claim, we're only looking at the HTTP response code (response.status_code). We completely ignore the other fields, like response.body which have more information about the call (click here for source)
  2. For transfer tokens, we are given a drain_id. We should be able to poll this drain_id for a text status (ex: pending, in progress, delayed, complete). iOS recently implemented a feature like this for QR code transfer to desktop. You can see where the callback for transfer tokens resolves, it passes in drain_id which can then be logged to brave://rewards-internals or saved to profile (click here for source)

Besides the support cost and impact to customers... code-maintenance-wise, the client code can be a bit hard to follow (lots of callbacks!). This would be a great example to clean up

@bsclifton bsclifton added feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop labels Apr 13, 2021
@Miyayes Miyayes added the priority/P2 A bad problem. We might uplift this to the next planned release. label Apr 21, 2021
@bsclifton
Copy link
Member Author

Some logging information has been captured with brave/brave-core#8598 (solving #15500)

@bsclifton
Copy link
Member Author

We should definitely log drain_id if possible; also the text errors logged could be more specific / helpful as we're now logging them with brave/brave-core#8598

@bsclifton
Copy link
Member Author

bsclifton commented Jun 9, 2021

Folks have been digging in (reviewing real logs of situation) and there have been some great findings 😄

One issue found / created which is tracked here: #15998

This might be the same as #15390 which @szilardszaloki is already taking a look into

@Miyayes
Copy link
Collaborator

Miyayes commented May 27, 2022

I think the issues in this have been resolved with @szilardszaloki's overall work and updates to Rewards + Uphold states, so will close this out :)

@Miyayes Miyayes closed this as completed May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

2 participants