brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.52k stars 2.27k forks source link

[Android] Artificial self custody linking case shouldn't let user get into verification flow - follow up to 35334 #36804

Closed LaurenWags closed 5 months ago

LaurenWags commented 5 months ago

Description

Found while testing https://github.com/brave/brave-browser/issues/35334

For the "Artificial case: Get invite even though custodian-linked" (@Miyayes or @LaurenWags can provide the doc with test plan), Android behaves differently than desktop. On desktop in this artificial case, while a notification dot is shown on the BAT logo (https://github.com/brave/brave-browser/issues/36121), there is no notification on the panel. On Android, the notification is shown and a user can go through the flow which will ultimately fail (as expected).

We should probably restrict them from getting into this flow when we know it will fail.

Steps to reproduce

  1. Create new profile, create a Brave Wallet
  2. Join Rewards and link to Uphold
  3. Get your Rewards Payment ID and ask for it to be whitelisted
  4. Enable the self custody flag. Restart the browser.
  5. Observe what happens and try to go through the process:
    • A notification dot appears on the BAT logo (https://github.com/brave/brave-browser/issues/36121 was previously logged as follow up for the notification dot)
    • The notification text/invite for self custody is shown on the panel (this does not happen on desktop)
    • After clicking on the CTA on the notification, I am able to attempt to link to Solana (I follow all the prompts with wallet)
    • However when I try to finish the linking, I get the "Something went wrong" error (as expected)

Since we know this flow will fail when user is connected to a custodian already, we should probably restrict them from getting into this flow.

Actual result

Screenshot_20240314-132249 Screenshot_20240314-132300 Screenshot_20240314-133314 Screenshot_20240314-133332

Expected result

No notification/CTA if user is mistakenly whitelisted while connected to a custodian

Issue reproduces how often

easily

Version/Channel Information:

Device details

Brave version

1.64.97

Website problems only

Additional information

cc @Miyayes @deeppandya

deeppandya commented 5 months ago

@LaurenWags what's the behavior we have on desktop ? i can match the same for android.

zenparsing commented 5 months ago

@deeppandya Can you automatically clear the notification if ShouldShowSelfCustodyInvite is false?

GeetaSarvadnya commented 4 months ago

Verification PASSED on Samsung Galaxy version 12 running Bravemonoarm64.apk_1.66.97