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

go from PENDING to NOT_CONNECTED when server returns wallets do not match #17265

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

Comments

@LaurenWags
Copy link
Member

Description

When server returns 403 "wallets do not match" message, then browser is in PENDING state and continues to try to link. Per discussion with @szilardszaloki and @Miyayes we should send to NOT_CONNECTED in this case.

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), and logs show 403 error for linking as expected.
  6. Close browser
  7. "Upgrade" (rename profile to Brave-Browser-Nightly) to 1.29.x
  8. Open panel and confirm your 2nd verified, KYC'd wallet from step 4 is no longer connected as expected
  9. UI shows pre-link state (UI, no balance) as expected. You still see 403 error in logs.

This is an upgrade case, but should also check clean profile case

Actual result:

Logs continue to show 403 as there is retry logic for PENDING state

Expected result:

Do not remain in PENDING, go to NOT_CONNECTED

@Miyayes also requested that we show some kind of messaging/notification/modal in this case per https://bravesoftware.slack.com/archives/CB0KCRCQN/p1627658993016800?thread_ts=1627655140.004600&cid=CB0KCRCQN

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:

maybe related to #16468 per https://bravesoftware.slack.com/archives/CB0KCRCQN/p1627655140004600

@LaurenWags
Copy link
Member Author

@brave/legacy_qa #17271 can be tested at the same time as this issue.

@LaurenWags
Copy link
Member Author

LaurenWags commented Aug 18, 2021

Verification 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)
Upgrade Case

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
Screen Shot 2021-08-18 at 2 34 21 PM Screen Shot 2021-08-18 at 2 36 12 PM

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

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

Additionally, looking at brave://rewards-internals I can now see that I am no longer in the "PENDING" state, I have moved (as expected) to "NOT_CONNECTED".

Example Example
Screen Shot 2021-08-18 at 2 52 28 PM Screen Shot 2021-08-18 at 2 52 42 PM
Clean Profile

Confirmed that after attempting to link the second KYC'd Uphold account I do not see the 403 errors repeatedly in the logs:

[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/7.............4/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}
[37143:775:0818/154412.656110:VERBOSE9:logging_util.cc(137)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/7........4/claim
[37143:775:0818/154412.656944:INFO:post_claim_uphold.cc(123)] Forbidden
[37143:775:0818/154412.657703:VERBOSE1:uphold.cc(188)] Disconnecting wallet

Confirmed message is shown on panel.
Confirmed UI returned to NOT_CONNECTED state.

Example Example Example Example
Screen Shot 2021-08-18 at 3 52 05 PM Screen Shot 2021-08-18 at 3 52 12 PM Screen Shot 2021-08-18 at 3 52 22 PM Screen Shot 2021-08-18 at 3 52 34 PM

Verified passed with

Brave	1.29.70 Chromium: 92.0.4515.159 (Official Build) beta (64-bit)
Revision	0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052}
OS	Linux
Clean Profile

Confirmed that after attempting to link the second KYC'd Uphold account I do not see the 403 errors repeatedly in the logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/11e68964-1232-46ba-bb4c-0769ccab5316/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJ.........
[7811:7811:0825/133132.808429:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/11e68964-1232-46ba-bb4c-0769ccab5316/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}
[7811:7811:0825/133132.809244:INFO:post_claim_uphold.cc(123)] Forbidden
[7811:7811:0825/133132.810540:VERBOSE1:uphold.cc(188)] Disconnecting wallet

Confirmed message is shown on panel.
Confirmed UI returned to NOT_CONNECTED state.

Example Example Example Example
Screen Shot 2021-08-25 at 4 33 49 PM Screen Shot 2021-08-25 at 4 34 10 PM Screen Shot 2021-08-25 at 4 34 26 PM Screen Shot 2021-08-25 at 4 34 58 PM

Verification passed on

Brave | 1.29.75 Chromium: 93.0.4577.58 (Official Build) (64-bit)
-- | --
Revision | c4410ece044414ea42fa4ba328d08195e818a99c-refs/branch-heads/4577@{#1076}
OS | Windows 10 OS Version 2009 (Build 19043.1165)

Upgrade Case

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

Connect KYC'd uphold account

Example Example
image image

Manual disconnect the 1st uphold account and then connect 2nd uphold account (kyc'd)

Logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/7........f/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJib2R5Ijp7ImRlbm9taW5hdGlvbiI6eyJhbW91bnQiOiIwIiwiY3VycmVuY3kiOiJCQVQifSwiZGVzdGluYXRpb24iOiJkMjM2ZTRkZC1mY2ExLTRmNzEtODc1Ni0zNzMzMmZhNGM1OTMifSwiaGVhZGVycyI6eyJkaWdlc3QiOiJTSEEtMjU2PUoybmFXRjY2UHI1aWh1bnZIZGxvUFNBOS8xdnFROWxlUU9PSUpSTUxWd1U9Iiwic2lnbmF0dXJlIjoia2V5SWQ9XCJwcmltYXJ5XCIsYWxnb3JpdGhtPVwiZWQyNTUxOVwiLGhlYWRlcnM9XCJkaWdlc3RcIixzaWduYXR1cmU9XCI1S01GRDFta0d2QjVpVmJjWkJOQ3I4QXRQOW1QR0lxVDI3VHBpZUdEQVJRMGRkajhBZEg4N3kwQWhvU1ZPUUJTT1JvM05nZlA2UDFSeWU2bjBPY1dCQT09XCIifSwib2N0ZXRzIjoie1wiZGVub21pbmF0aW9uXCI6e1wiYW1vdW50XCI6XCIwXCIsXCJjdXJyZW5jeVwiOlwiQkFUXCJ9LFwiZGVzdGluYXRpb25cIjpcImQyMzZlNGRkLWZjYTEtNGY3MS04NzU2LTM3MzMyZmE0YzU5M1wifSJ9"}
> Content Type: application/json; charset=utf-8
[16924:20368:0830/230921.023:VERBOSE6:logging_util.cc(136)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/7......f/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}

[16924:20368:0830/230921.024: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
image image

Additionally, looking at brave://rewards-internals I can now see that I am no longer in the "PENDING" state, I have moved (as expected) to "NOT_CONNECTED".

Example Example
image image
Clean Profile

Confirmed that after attempting to link the second KYC'd Uphold account I do not see the 403 errors repeatedly in the logs:
Logs:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/c3e5d8a5-ab81-4067-a139-9e64cb4808c3/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJib.....
> Content Type: application/json; charset=utf-8
[13220:16276:0830/232858.778:VERBOSE6:logging_util.cc(136)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/c3e5d8a5-ab81-4067-a139-9e64cb4808c3/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}

[13220:16276:0830/232858.780:INFO:post_claim_uphold.cc(123)] Forbidden
[13220:16276:0830/232858.785:VERBOSE1:uphold.cc(188)] Disconnecting wallet
[13220:16276:0830/232858.804:VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED.

Confirmed message is shown on panel.
Confirmed UI returned to NOT_CONNECTED state.

Example Example Example Example
image image image image

@LaurenWags LaurenWags added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-Linux and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment