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

Uphold retry-loop in PENDING state doesn't display PENDING UI. #17316

Closed
szilardszaloki opened this issue Aug 3, 2021 · 1 comment · Fixed by brave/brave-core#9634
Closed

Comments

@szilardszaloki
Copy link
Contributor

szilardszaloki commented Aug 3, 2021

Description

In the wallet generation flow the wallet enters the retry-loop on API failures.
This results in the PENDING state and the corresponding UI should be displayed.

Steps to Reproduce

  1. fake a faulty endpoint, e.g. with Charles Proxy (get user (Uphold) / create card (Uphold) / update card settings (Uphold) / get anon funds (Rewards) / link (Rewards))
  2. try linking your Rewards wallet with a KYC'd Uphold account

Actual result:

actual

Expected result:

expected

Reproduces how often:

Only reproducible with a faulty endpoint.

Brave version (brave://version info)

Brave 1.29.45 Chromium: 92.0.4515.115 (Developer Build) (64-bit)
Revision 48cb2f4029b84b003719740a6cf9ca73f374a857-refs/branch-heads/4515_105@{#4}
OS Windows 10 OS Version 2009 (Build 19043.1110)

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? N/A

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? N/A
  • Does the issue resolve itself when disabling Brave Rewards? N/A
  • Is the issue reproducible on the latest version of Chrome? N/A

Miscellaneous Information:

@szilardszaloki szilardszaloki self-assigned this Aug 3, 2021
@szilardszaloki szilardszaloki changed the title Uphold retry-loop in PENDING state doesn't display PENDING UI. Uphold retry-loop in PENDING state doesn't display PENDING UI. Aug 3, 2021
@szilardszaloki szilardszaloki added this to the 1.29.x - Nightly milestone Aug 4, 2021
@LaurenWags LaurenWags added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Aug 17, 2021
@LaurenWags
Copy link
Member

LaurenWags commented Aug 17, 2021

Verified passed with

Brave	1.29.61 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)
Scenario 1 - `get user` (Uphold) - PASSED

Used Charles Proxy to rewrite the response to https://api-sandbox.uphold.com/v0/me from 200 --> 404.
Confirmed that the logs reflected this rewrite:

[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me
> Method: GET
[32381:775:0817/155625.420725:VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED.
[32381:775:0817/155625.447447:VERBOSE2:tab_manager.cc(77)] Tab id 4 was updated
[32381:775:0817/155625.447908:VERBOSE6:user_activity.cc(41)] Triggered event: 11 (8:2:3600 s)
[32381:775:0817/155625.515965:VERBOSE7:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me
> Result: Failure
> HTTP Code: 404
[32381:775:0817/155625.517126:INFO:get_me.cc(64)] Unexpected HTTP status: 404
[32381:775:0817/155625.518295:INFO:uphold_user.cc(69)] Couldn't get user
[32381:775:0817/155625.519851:INFO:uphold_wallet.cc(110)] Couldn't get the user object from Uphold!

Confirmed the UI shows the "Pending" state:

get user pending
Scenario 2 - `create card` (Uphold) - PASSED

Used Charles Proxy to rewrite the response to https://api-sandbox.uphold.com/v0/me/cards from 200 --> 404.
Confirmed that the logs reflected this rewrite:

[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards
> Method: POST
> Content: {"currency":"BAT","label":"Brave Browser"}
> Content Type: application/json; charset=utf-8
[32381:775:0817/161916.133376:VERBOSE7:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards
> Result: Failure
> HTTP Code: 404
> Body: {"CreatedByApplicationId":"193a7.........
[32381:775:0817/161916.134543:INFO:post_cards.cc(51)] Unexpected HTTP status: 404
[32381:775:0817/161916.135387:INFO:uphold_card.cc(75)] Couldn't create BAT card!
[32381:775:0817/161916.139064:VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED.

Confirmed the UI shows the "Pending" state:

get card ID pending
Scenario 3 - `update card settings` (Uphold) - PASSED

Used Charles Proxy to rewrite the response to

Confirmed that the logs reflected this rewrite:

[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[33968:775:0818/084623.849034:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Failure
> HTTP Code: 404
> Body: [{"CreatedByApplicationId":"193a...........
[ RESPONSE HEADERS ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
[33968:775:0818/084623.850609:INFO:get_cards.cc(41)] Unexpected HTTP status: 404
[33968:775:0818/084623.850675:VERBOSE1:uphold_card.cc(50)] Couldn't get BAT card ID!
[33968:775:0818/084623.852747:VERBOSE5:ledger_impl.cc(119)] 
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards
> Method: POST
> Content: {"currency":"BAT","label":"Brave Browser"}
> Content Type: application/json; charset=utf-8
[33968:775:0818/084623.943853:VERBOSE7:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards
> Result: Success
> HTTP Code: 200
> Body: {"CreatedByApplicationId":"193a...........
[33968:775:0818/084623.943996:VERBOSE9:logging_util.cc(137)] 
[ RESPONSE HEADERS ]
> Url: https://api-sandbox.uphold.com/v0/me/cards
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards/0f57ba85-3306-40a1-9d62-ad996e6d0948
> Method: PATCH
> Content: {"settings":{"position":1,"starred":true}}
> Content Type: application/json; charset=utf-8
[33968:775:0818/084624.079194:VERBOSE6:logging_util.cc(136)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards/0f57ba85-3306-40a1-9d62-ad996e6d0948
> Result: Failure
> HTTP Code: 404
> Body: {"CreatedByApplicationId":"193a.......
[33968:775:0818/084624.079377:VERBOSE9:logging_util.cc(137)] 
[ RESPONSE HEADERS ]
> Url: https://api-sandbox.uphold.com/v0/me/cards/0f57ba85-3306-40a1-9d62-ad996e6d0948
[33968:775:0818/084624.080641:INFO:patch_card.cc(52)] Unexpected HTTP status: 404
[33968:775:0818/084624.081559:INFO:uphold_card.cc(109)] Couldn't update BAT card settings!

Confirmed the UI shows the "Pending" state:

update card settings pending

Scenario 4 - get anon funds (Rewards) - skipped per discussion with Szilard

Scenario 5 - `link` (Rewards) - PASSED

Used Charles Proxy to rewrite the response to

Confirmed that the logs reflected this rewrite:

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/cec0036f-3b45-46ab-95da-9e82bb181b9c/claim
> Method: POST
> Content: {"signedLinkingRequest":"eyJ.........
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/cec0036f-3b45-46ab-95da-9e82bb181b9c/claim
> Result: Failure
> HTTP Code: 404
> Body: null
[35221:775:0818/104615.975683:VERBOSE9:logging_util.cc(137)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/cec0036f-3b45-46ab-95da-9e82bb181b9c/claim
[35221:775:0818/104615.976861:INFO:post_claim_uphold.cc(128)] Not found

Confirmed the UI shows the "Pending" state:

link pending

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

Successfully merging a pull request may close this issue.

2 participants