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

crash when trying to re-link previous Uphold account in certain case #17259

Closed
LaurenWags opened this issue Jul 30, 2021 · 2 comments · Fixed by brave/brave-core#9622
Closed

Comments

@LaurenWags
Copy link
Member

Description

Found while testing #15390

In the scenario below I was correctly kicked out of the semi-verified state when upgrading to 1.29.x, but when I tried to re-link my account the browser crashed.

Steps to Reproduce

  1. Using current release version, 1.27.109, 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), but logs show 403 error for linking

example logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/3........7/claim
> Method: POST
> Content: {"signedLinkingRequest":"ey...........
> Content Type: application/json; charset=utf-8
[99975:775:0730/084522.183930:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/3.............7/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}
[99975:775:0730/084522.185136:INFO:post_claim_uphold.cc(112)] Forbidden
  1. Close browser
  2. "Upgrade" (rename profile to Brave-Browser-Nightly) to 1.29.x
  3. Open panel and confirm your 2nd verified, KYC'd wallet from step 4 is no longer connected
  4. UI shows pre-link state (UI, no balance) as expected. You still see 403 error in logs, I guess this is ok?

example logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/3.........7/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJ..........
> Content Type: application/json; charset=utf-8
[266:775:0730/084942.492632:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/3............7/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. From panel, click on "Verify wallet"
    --> brave://rewards/#verify loads in a new tab but it is blank
    --> refresh this page, it loads
  2. Click on Continue on the modal
  3. Click on Uphold
  4. Click on "Continue to login" link
    --> Browser crashes. Example Uploaded crash report ID: 3cdc2c00-217a-ae06-0000-000000000000

Note, if in step 10 you click on "Verify wallet" from brave://rewards page not panel, no modal ever opens. There is also no crash. The logs just keep trying to link and you keep getting the 403 response.

Actual result:

browser crashes

Expected result:

no crash

Reproduces how often:

easily

Brave version (brave://version info)

Brave 1.29.40 Chromium: 92.0.4515.115 (Official Build) nightly (x86_64)
Revision 48cb2f4029b84b003719740a6cf9ca73f374a857-refs/branch-heads/4515_105@{#4}
OS macOS Version 10.15.7 (Build 19H1217)

Version/Channel Information:

  • Can you reproduce this issue with the current release? n/a
  • Can you reproduce this issue with the beta channel? n/a
  • 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

@szilardszaloki
Copy link
Contributor

This crash itself is originally Gemini-related, but now it gets picked up by all the custodian implementations (it gets resolved by brave/brave-core#9622).
For the Uphold retry-loop in the PENDING state, I filed #17316.

@LaurenWags
Copy link
Member Author

LaurenWags commented Aug 18, 2021

Verified passed with

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

Verified STR from description.
Confirmed 1.28.105 is in the correct state:

Example Example
Screen Shot 2021-08-18 at 2 31 39 PM Screen Shot 2021-08-18 at 2 31 50 PM

Logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/d..........5/claim
> Method: POST
> Content: {"signedLinkingRequest":"ey.......
[36757:775:0818/143029.086406:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/d.........5/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}

Upgrade to 1.29.x.
After opening the panel in 1.29.x I now see the notification from #17271 and #16468 which is expected. Closing this notification shows the pre-link state, which is also expected.

Example Example Example Example
Screen Shot 2021-08-18 at 2 34 21 PM Screen Shot 2021-08-18 at 2 36 12 PM Screen Shot 2021-08-18 at 2 52 28 PM Screen Shot 2021-08-18 at 2 52 42 PM

Logs do not repeatedly show the 403 error, which is expected now per #17265.

Logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/d........5/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJi.....
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/d.........5/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}
[36901:775:0818/143414.889469:INFO:post_claim_uphold.cc(123)] Forbidden
[36901:775:0818/143414.890496:VERBOSE1:uphold.cc(188)] Disconnecting wallet

I clicked on "Verify wallet" from panel and brave://rewards/#verify opened in a new tab (not blank).
Clicked Continue, then selected Uphold.
Clicked on "Continue to login" link and confirmed no crash.

Note - still unable to connect this second account which is expected since verifying a single wallet with multiple of the same custodian is not allowed.


Verification passed on


Brave | 1.29.64 Chromium: 92.0.4515.159 (Official Build) beta (64-bit)
-- | --
Revision | 0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052}
OS | Windows 10 OS Version 2009 (Build 19043.1165)


Verified STR from description.
Confirmed 1.28.106 is in the correct state:

Example Example
image image

Logs after linking 2nd uphold account

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/e......d/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJib2R5Ijp7ImRlbm9taW5hdGlvbiI6eyJhbW91bnQiOiIwIiwiY3VycmVuY3kiOiJCQVQifSwiZGVzdGluYXRpb24iOiJkMjM2ZTRkZC1mY2ExLTRmNzEtODc1Ni0zNzMzMmZhNGM1OTMifSwiaGVhZGVycyI6eyJkaWdlc3QiOiJTSEEtMjU2PUoybmFXRjY2UHI1aWh1bnZIZGxvUFNBOS8xdnFROWxlUU9PSUpSTUxWd1U9Iiwic2lnbmF0dXJlIjoia2V5SWQ9XCJwcmltYXJ5XCIsYWxnb3JpdGhtPVwiZWQyNTUxOVwiLGhlYWRlcnM9XCJkaWdlc3RcIixzaWduYXR1cmU9XCI0VFpnMWRWdGNORTViMjZBclM1YUpUYXZhUk14ZG9YWWNHa2lhOXdLL0xLZzlMZHBhaEsyMFVxNnFKQkRBYktXczYrNGoxU2JyV1N3MGFrdUovaHRBZz09XCIifSwib2N0ZXRzIjoie1wiZGVub21pbmF0aW9uXCI6e1wiYW1vdW50XCI6XCIwXCIsXCJjdXJyZW5jeVwiOlwiQkFUXCJ9LFwiZGVzdGluYXRpb25cIjpcImQyMzZlNGRkLWZjYTEtNGY3MS04NzU2LTM3MzMyZmE0YzU5M1wifSJ9"}
> Content Type: application/json; charset=utf-8
[18772:8956:0823/223543.187:VERBOSE1:browser_manager.cc(52)] Browser window is active
[18772:8956:0823/223543.203:VERBOSE6:user_activity.cc(41)] Triggered event: 16 (1.5:2:3600 s)
[18772:8956:0823/223543.204:VERBOSE2:tab_manager.cc(77)] Tab id 4 was updated
[18772:8956:0823/223543.210:VERBOSE6:user_activity.cc(41)] Triggered event: 11 (1.5:2:3600 s)
[18772:8956:0823/223543.487:VERBOSE6:logging_util.cc(136)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/e......d/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}

[18772:8956:0823/223543.491:INFO:post_claim_uphold.cc(112)] Forbidden

Upgrade to 1.29.x.
After opening the panel in 1.29.x I now see the notification from #17271 and #16468 which is expected. Closing this notification shows the pre-link state, which is also expected.

Example Example Example Example
image image image image

Logs do not repeatedly show the 403 error, which is expected now per #17265.

Logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/e......d/claim
> Method: POST
> Content: {"signedLinkingRequest":"ey...."}

[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/e.....d/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}

[3248:18332:0823/224040.541:INFO:post_claim_uphold.cc(123)] Forbidden
[3248:18332:0823/224040.550:VERBOSE1:uphold.cc(188)] Disconnecting wallet

I clicked on "Verify wallet" from panel and brave://rewards/#verify opened in a new tab (not blank).
Clicked Continue, then selected Uphold.
Clicked on "Continue to login" link and confirmed no crash.

Expected/known - still unable to connect this second account which is expected since verifying a single wallet with multiple of the same custodian is not allowed.


Verification passed on

Brave 1.29.67 Chromium: 92.0.4515.159 (Official Build) beta (64-bit)
Revision 0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052}
OS Ubuntu 18.04 LTS

Verified test plan from the description. Verified no crash.

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment