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

Exit retry-loop when user tries linking their wallet with a different Uphold account. #9669

Conversation

szilardszaloki
Copy link
Collaborator

@szilardszaloki szilardszaloki commented Aug 5, 2021

Resolves brave/brave-browser#17271, resolves brave/brave-browser#17265.

  • adding the mismatched provider accounts notification
    different_account_notification
  • kicking back the wallet to NOT_CONNECTED
  • adjusting unit tests

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@szilardszaloki szilardszaloki requested a review from a team as a code owner August 5, 2021 16:14
@szilardszaloki szilardszaloki self-assigned this Aug 5, 2021
@szilardszaloki szilardszaloki force-pushed the sszaloki-17271-show-notification-on-two-different-uphold-accounts branch 3 times, most recently from 548f7b4 to e0e8ad3 Compare August 10, 2021 18:28
@szilardszaloki szilardszaloki force-pushed the sszaloki-17271-show-notification-on-two-different-uphold-accounts branch from e0e8ad3 to 6cf734d Compare August 10, 2021 20:08
…ent Uphold account.

Adding the "mismatched provider accounts" notification.
Kicking back the wallet to NOT_CONNECTED.
Adjusting unit tests.
@szilardszaloki szilardszaloki force-pushed the sszaloki-17271-show-notification-on-two-different-uphold-accounts branch from 6cf734d to 130ba33 Compare August 10, 2021 20:10
@szilardszaloki szilardszaloki merged commit 44c2f3a into master Aug 10, 2021
@szilardszaloki szilardszaloki deleted the sszaloki-17271-show-notification-on-two-different-uphold-accounts branch August 10, 2021 22:52
brave-builds pushed a commit that referenced this pull request Aug 10, 2021
@szilardszaloki szilardszaloki added this to the 1.30.x - Nightly milestone Aug 10, 2021
@bsclifton
Copy link
Member

Nice work on this! This is a great fix 😄

@LaurenWags
Copy link
Member

LaurenWags commented Aug 11, 2021

Verified with

Brave | 1.30.14 Chromium: 92.0.4515.131 (Official Build) nightly (x86_64)
-- | --
Revision | 6b8d6c56ce21e38a72f7c4becb5abc1fa5134f29-refs/branch-heads/4515@{#1933}
OS | macOS Version 10.15.7 (Build 19H1323)

Scenario 1: Clean profile

  1. Clean install 1.30.14, staging env
  2. Enable Rewards, link KYC'd Uphold wallet
  3. Manually disconnect from Uphold (from wallet panel)
  4. Confirm you are returned to pre-link state (UI, no balance, etc)
  5. Link a second (different) KYC'd Uphold wallet
  6. Confirm logs show 403 error like below once (not continuously):
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/5...............6/claim
> Result: Failure
> HTTP Code: 403
> Body: {"message":"error linking wallet: unable to link wallets: unable to match wallets: wallets do not match","code":403}
  1. Confirm UI does not show "Wallet verified" or a balance
  2. Confirm notification requested in Show error notification when user tries to connect second custodian account in wallet generation flow brave-browser#17271 is shown:

Screen Shot 2021-08-11 at 8 56 39 AM

  1. "Learn more" button links to https://support.brave.com/hc/en-us/articles/360034841711-What-is-a-verified-wallet-
  2. Confirm "x" closes the notification
  3. Confirmed wallet was sent back to NOT_CONNECTED
Example Example
1 2

TBD:
Scenario 2: Upgrade profile

  1. Using current release version, 1.27.111, clean profile, staging env, enable Rewards, link KYC'd Uphold wallet
  2. Manually disconnect from Uphold (from wallet panel)
  3. Confirm you are returned to pre-link state (UI, no balance, etc)
  4. Link a second (different) KYC'd Uphold wallet
  5. Confirm UI appears fine (UI, balance is shown), and logs show 403 error for linking as expected.
  6. Close browser
  7. "Upgrade" (rename profile to Brave-Browser-Nightly) to 1.30.x
  8. Confirm logs show 403 error once (not continuously)
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/1...........8/claim
> Result: Failure
> HTTP Code: 403
> Body: {"message":"error linking wallet: unable to link wallets: unable to match wallets: wallets do not match","code":403}
  1. Open panel and confirm notification requested in Show error notification when user tries to connect second custodian account in wallet generation flow brave-browser#17271 is shown

Screen Shot 2021-08-11 at 12 36 57 PM

  1. "Learn more" button links to https://support.brave.com/hc/en-us/articles/360034841711-What-is-a-verified-wallet-
  2. Confirm "x" closes the notification
  3. Confirmed wallet was sent back to NOT_CONNECTED
Example Example
Screen Shot 2021-08-11 at 12 37 18 PM Screen Shot 2021-08-11 at 12 37 36 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants