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 linking always creates a new card #35445

Closed
zenparsing opened this issue Jan 19, 2024 · 6 comments · Fixed by brave/brave-core#21647
Closed

Uphold linking always creates a new card #35445

zenparsing opened this issue Jan 19, 2024 · 6 comments · Fixed by brave/brave-core#21647

Comments

@zenparsing
Copy link

Uphold is now returning an HTTP status code of 206 on success from the /v0/me/cards?q=currency:BAT. This endpoint is used to determine if the user has an existing "Brave Browser" card. If the user has an existing card, then that card is used for Rewards operations. Otherwise, a new card is created with the label "Brave Browser".

Uphold is now returning 206 from this endpoint, which the Rewards client does not recognize.

@kjozwiak
Copy link
Member

kjozwiak commented Feb 5, 2024

Adding QA/Blocked as the above will potentially be uplifted into 1.62.x via brave/brave-core#21885 once we verify/confirm that brave/brave-core#21647 hasn't caused any issues and that both of 200 & 206 are working as expected.

@LaurenWags
Copy link
Member

LaurenWags commented Feb 5, 2024

Verified with

Brave | 1.63.145 Chromium: 121.0.6167.139 (Official Build) beta (x86_64)
-- | --
Revision | 73dc726c461ceae35c2aa15c4a2d9e6736b5c86d
OS | macOS Version 13.6.4 (Build 22G513)

Case 1 - 206 Response code - PASSED

Possible pre-req: if Uphold is sending 200 in sandbox, need to create a Charles Proxy rewrite rule to change it to 206

  1. Created a clean profile using 1.63.145
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[56755:259:0205/100434.067343:VERBOSE1:url_loader.cc(111)] 
[ RESPONSE ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193a7........
  1. Confirmed I could still see a balance in rewards
1 2 3

Case 2 - 200 Response code - PASSED

  1. Created a clean profile using 1.63.145
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[56946:259:0205/101249.270917:VERBOSE1:url_loader.cc(111)] 
[ RESPONSE ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"193a7......
  1. Confirmed I could still see a balance in rewards
1 2

Case 3 - Initial connection with 200 Response code, Reconnect with 206 Response code - PASSED

pre-req: have Charles Proxy running, but do not have rewrite rule for 206 response code enabled

  1. Created a clean profile using 1.63.145
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[57271:259:0205/102958.381976:VERBOSE1:url_loader.cc(111)] 
[ RESPONSE ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"193a77c.....
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-05 at 10 30 44 AM Screenshot 2024-02-05 at 10 30 53 AM Screenshot 2024-02-05 at 10 31 02 AM
  1. Remove integration with Uphold
  2. Confirm shows "Logged out" state in UI
Screenshot 2024-02-05 at 10 32 16 AM Screenshot 2024-02-05 at 10 32 23 AM
  1. Enable Charles Proxy rewrite rule for 206 response
  2. Reconnect rewards to Uphold
  3. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[57271:259:0205/103341.605485:VERBOSE1:url_loader.cc(111)] 
[ RESPONSE ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193a77.......
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-05 at 10 34 26 AM Screenshot 2024-02-05 at 10 34 38 AM Screenshot 2024-02-05 at 10 34 45 AM

@kjozwiak
Copy link
Member

kjozwiak commented Feb 5, 2024

Thanks for running through #35445 (comment) to make sure everything is working as expected via 1.63.x. The above requires 1.62.161 or higher for 1.62.x verification 👍

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Feb 6, 2024

Verification PASSED on

Brave | 1.62.161 Chromium: 121.0.6167.139 (Official Build) (64-bit)
-- | --
Revision | 9afaacd1500fdbd60ed4500b63b9ab85597ef933
OS | Windows 10 Version 22H2 (Build 19045.3930)

Case 1 - 206 Response code - PASSED

Possible pre-req: if Uphold is sending 200 in sandbox, need to create a Charles Proxy rewrite rule to change it to 206

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[18032:26840:0206/195232.414:VERBOSE6:logging_util.cc(120)]
....
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193...}]}]
[18032:26840:0206/195232.417:VERBOSE9:logging_util.cc(121)]
  1. Confirmed I could still see a balance in rewards
charles BR panel Rewards settings page
image image image

Case 2 - 200 Response code - PASSED

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
....
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"19...."}]}]
[18292:10724:0206/172249.536:VERBOSE9:logging_util.cc(121)]

  1. Confirmed I could still see a balance in rewards
BR panel Rewards settings page
image image

Case 3 - Initial connection with 200 Response code, Reconnect with 206 Response code - PASSED

pre-req: have Charles Proxy running, but do not have rewrite rule for 206 response code enabled

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[16392:23664:0206/200151.861:VERBOSE6:logging_util.cc(120)]
....
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"193a...."}]}]
[16392:23664:0206/200151.864:VERBOSE9:logging_util.cc(121)]
  1. Confirmed I could still see a balance in rewards
charles BR panel Rewards settings page
image image image
  1. Remove integration with Uphold
  2. Confirm shows "Logged out" state in UI
image image
  1. Enable Charles Proxy rewrite rule for 206 response
  2. Reconnect rewards to Uphold
  3. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[7460:13500:0206/200820.202:VERBOSE1:user_idle_detection.cc(46)] User is idle
[7460:13500:0206/200820.270:VERBOSE6:logging_util.cc(120)]
....
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193a7...}]}]
[7460:13500:0206/200820.271:VERBOSE9:logging_util.cc(121)]

  1. Confirmed I could still see a balance in rewards
image image image

@GeetaSarvadnya GeetaSarvadnya added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Feb 6, 2024
@LaurenWags LaurenWags added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Feb 6, 2024
@LaurenWags
Copy link
Member

LaurenWags commented Feb 6, 2024

Verified with

Brave | 1.62.161 Chromium: 121.0.6167.139 (Official Build) (x86_64)
-- | --
Revision | 9afaacd1500fdbd60ed4500b63b9ab85597ef933
OS | macOS Version 13.6.4 (Build 22G513)

Case 1 - 206 Response code - PASSED

Possible pre-req: if Uphold is sending 200 in sandbox, need to create a Charles Proxy rewrite rule to change it to 206

  1. Created a clean profile using 1.62.x
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[66338:259:0206/100829.627741:VERBOSE6:logging_util.cc(120)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193a77......
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-06 at 10 09 27 AM Screenshot 2024-02-06 at 10 09 38 AM Screenshot 2024-02-06 at 10 09 45 AM

Case 2 - 200 Response code - PASSED

  1. Created a clean profile using 1.62.x
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[66595:259:0206/102032.999883:VERBOSE6:logging_util.cc(120)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"193a77......
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-06 at 10 21 35 AM Screenshot 2024-02-06 at 10 21 41 AM

Case 3 - Initial connection with 200 Response code, Reconnect with 206 Response code - PASSED

pre-req: have Charles Proxy running, but do not have rewrite rule for 206 response code enabled

  1. Created a clean profile using 1.62.x
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[66928:259:0206/103754.651903:VERBOSE6:logging_util.cc(120)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 200
> Body: [{"CreatedByApplicationId":"193a77c......
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-06 at 10 38 57 AM Screenshot 2024-02-06 at 10 39 19 AM Screenshot 2024-02-06 at 10 39 27 AM
  1. Remove integration with Uphold
  2. Confirm shows "Logged out" state in UI
Screenshot 2024-02-06 at 10 40 56 AM Screenshot 2024-02-06 at 10 41 16 AM
  1. Enable Charles Proxy rewrite rule for 206 response
  2. Reconnect rewards to Uphold
  3. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Method: GET
[66928:259:0206/104219.917389:VERBOSE6:logging_util.cc(120)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
> Result: Success
> HTTP Code: 206
> Body: [{"CreatedByApplicationId":"193a77......
  1. Confirmed I could still see a balance in rewards
Screenshot 2024-02-06 at 10 43 17 AM Screenshot 2024-02-06 at 10 43 31 AM Screenshot 2024-02-06 at 10 43 36 AM

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Feb 6, 2024

Verification PASSED on Samsung galaxy version 12 running Bravemonoarm64.apk_1.62.161

Case 1 - 206 Response code - PASSED

Possible pre-req: if Uphold is sending 200 in sandbox, need to create a Charles Proxy rewrite rule to change it to 206

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
 [ REQUEST ]
    > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Method: GET
2024-02-06 21:22:43.313 26875-26875/? V/chromium: [VERBOSE6:logging_util.cc(120)] 
    [ RESPONSE - OnRequest ]
    > Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Result: Success
    > HTTP Code: 206
    > Body: [{"CreatedByApplicationId":"193a77...."}]}]
2024-02-06 21:22:43.352 26875-26875/? V/chromium: [VERBOSE5:rewards_engine_impl.h(256)] 
  1. Confirmed I could still see a balance in rewards
charles BR panel Rewards settings page
image Screenshot_20240206_212345_Brave Screenshot_20240206_212338_Brave

Case 2 - 200 Response code - PASSED

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
 [ REQUEST ]
    > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Method: GET
2024-02-06 21:12:13.657 17806-17806/? V/chromium: [VERBOSE6:logging_util.cc(120)] 
    [ RESPONSE - OnRequest ]
    > Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Result: Success
    > HTTP Code: 200
    > Body: [{"CreatedByApplicationId":"193a...."}]}]
2024-02-06 21:12:13.704 17806-17806/? V/chromium: [VERBOSE5:rewards_engine_impl.h(256)] 
  1. Confirmed I could still see a balance in rewards
BR panel Rewards settings page
Screenshot_20240206_211237_Brave Screenshot_20240206_211227_Brave

Case 3 - Initial connection with 200 Response code, Reconnect with 206 Response code - PASSED

pre-req: have Charles Proxy running, but do not have rewrite rule for 206 response code enabled

  1. Created a clean profile using 1.62.161
  2. Closed and relaunched to pull griffin
  3. Enabled Rewards
  4. Connected a custodian with a non-zero balance
  5. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was 200:
  [ REQUEST ]
    > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Method: GET
2024-02-06 21:50:50.593 12245-12245/? V/chromium: [VERBOSE6:logging_util.cc(120)] 
    [ RESPONSE - OnRequest ]
    > Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Result: Success
    > HTTP Code: 200
    > Body: [{"CreatedByApplicationId":"193a77c..."}]}]
2024-02-06 21:50:50.632 12245-12245/? V/chromium: [VERBOSE5:rewards_engine_impl.h(256)] 
  1. Confirmed I could still see a balance in rewards
charles BR panel Rewards settings page
image Screenshot_20240206_215206_Brave Screenshot_20240206_215212_Brave
  1. Remove integration with Uphold
  2. Confirm shows "Logged out" state in UI
Screenshot_20240206_215356_Brave Screenshot_20240206_215408_Brave
  1. Enable Charles Proxy rewrite rule for 206 response
  2. Reconnect rewards to Uphold
  3. Confirmed the response code for https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT was rewritten to be 206:
  [ REQUEST ]
    > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Method: GET
2024-02-06 21:56:31.583 15292-15292/? V/chromium: [VERBOSE6:logging_util.cc(120)] 
    [ RESPONSE - OnRequest ]
    > Url: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT
    > Result: Success
    > HTTP Code: 206
    > Body: [{"CreatedByApplicationId":"193a77cf..."}]}]
2024-02-06 21:56:31.632 15292-15292/? V/chromium: [VERBOSE5:rewards_engine_impl.h(256)] 

  1. Confirmed I could still see a balance in rewards
image Screenshot_20240206_215644_Brave Screenshot_20240206_215655_Brave

@GeetaSarvadnya GeetaSarvadnya added QA Pass - Android ARM and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment