-
Notifications
You must be signed in to change notification settings - Fork 904
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
Remove semi-verified state #9212
Remove semi-verified state #9212
Conversation
3ff4dc7
to
68887b4
Compare
Ran through the following scenario:
While my account is a valid account, I never did the ID verify / KYC process. Should this be If blocking is intended (which I think it is - this is the intention of the PR, right?), the modal text could use some polish. It says: Maybe we should reword this to be something like: |
The basic idea is indeed to defer setting the wallet status to |
3c2e230
to
64f88b7
Compare
...ive-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_update_card.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_util.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_util.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/wallet/wallet.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.cc
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.cc
Outdated
Show resolved
Hide resolved
components/brave_rewards/resources/extension/brave_rewards/_locales/en_US/messages.json
Outdated
Show resolved
Hide resolved
ledger_(ledger), | ||
uphold_server_(std::make_unique<endpoint::UpholdServer>(ledger)) { | ||
void UpholdCard::CreateBATCardIfNecessary(CreateCardCallback callback) const { | ||
GetBATCardId(std::bind(&UpholdCard::OnGetBATCardId, this, _1, _2, callback)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, the nested callback pattern (where a sub-flow is executed with a callback which itself is bound to a callback for the outer flow) becomes difficult to read when the subflows are defined within the same file.
Totally fine to structure this flow how you think best, but FWIW I tend to prefer a more linear callback approach within a single file (or class).
components/brave_rewards/resources/extension/brave_rewards/components/panel.tsx
Outdated
Show resolved
Hide resolved
components/brave_rewards/resources/ui/components/walletWrapper/index.tsx
Outdated
Show resolved
Hide resolved
...r/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold_unittest.cc
Outdated
Show resolved
Hide resolved
64f88b7
to
af862f6
Compare
So I think we'd only need to consider the text change, which can help provide more insight. Since I have 30 available, the 15 BAT part is confusing (as the real root cause is needing to do verify). I would imagine the check for 15 BAT happens first - so this modal may be used in two places (we'd need to check) |
af862f6
to
6408be4
Compare
TL;DR: Here's how the authorization goes:
Currently, I don't see why we should redirect to this modal, since I don't see an enforced minimum requirement on our end. What do you think? |
|
@jumde Sure thing!🙂 |
3d3644c
to
fef29a8
Compare
cb71207
to
23a8db4
Compare
FYI: the Uphold wallet state diagram just got updated. |
a089959
to
5fe84e5
Compare
d1a1ed8
to
3b89259
Compare
…f the PENDING state.
…ser, pending_user, restricted_user, unverified_user). Avoiding double notifications on the UI. DisconnectWallet() used to display only wallet_disconnected notifications. Now it takes the type of the notification via a function parameter.
Copyright year, removing UpdateCard, renaming brave_wallet to rewards_wallet (and adjusting logging), writing state transition comments in prose.
Added a utility function for wallet status logging.
Adding StateMigrationV10 (state_migration_v10.h, state_migration_v10.cc). Adding wallet info endpoint client implementation (get_wallet.h, get_wallet.cc).
…er (after a thorough discussion).
…NNECTED state (as it's already removed), or from the equivalent state (PENDING) in the new state machine. Removing TipConnectedPublisherConnected from RewardsContributionBrowserTest.
Adding NOT_CONNECTED ==> NOT_CONNECTED, CONNECTED ==> NOT_CONNECTED, CONNECTED ==> PENDING, DISCONNECTED_NOT_VERIFIED ==> DISCONNECTED_VERIFIED, DISCONNECTED_VERIFIED ==> DISCONNECTED_VERIFIED, PENDING ==> NOT_CONNECTED, PENDING ==> PENDING, VERIFIED ==> DISCONNECTED_VERIFIED and VERIFIED ==> PENDING test cases to RewardsStateBrowserTest.
Introducing onEvent in Panel. Attempting the delete_claim request, no matter if Uphold wallet is null or if it's in a bad state.
Adding Authorize.Paths, Generate.Paths, GetUser.Paths, GetCardID.Paths, GetAnonFunds.Paths, LinkWallet.Paths and DisconnectWallet.Paths to UpholdTest. Showing the error modal (from UpholdAuthorization::OnAuthorize(), too) if the user tries to re-authorize in PENDING or VERIFIED. Returning type::Result::LEDGER_ERROR on linkage failure (to be symmetric with how bitFlyer works). Changing the title for upholdPendingUserNotification.
…et Wallet endpoint's client. Adding Get Wallet endpoint unit tests.
Fixing unit tests covering the Uphold wallet state machine (adjusting the common ResetWallet() (as the Uphold wallet state machine now uses only 4 states)). Fixing browser tests covering the Uphold wallet status migration (adding the code_verifier field). Removing dead code from bitflyer_util, gemini_util and uphold_util.
The memberAt field contains the date when the user became a verified member at Uphold, which indicates the date when the user first KYC'd at Uphold (the memberAt field is not getting cleared ever). Since being KYC'd ==> memberAt != null <==> verified == true, it's virtually impossible for an account to be !verified after having successfully authorized with Uphold via Rewards (as of August 2020 we require users to be KYC'd).
2c70c92
to
dd6b778
Compare
|
Resolves brave/brave-browser#15390 and brave/brave-browser#16468.
NOT_CONNECTED
,CONNECTED
,VERIFIED
,DISCONNECTED_NOT_VERIFIED
,DISCONNECTED_VERIFIED
,PENDING
NOT_CONNECTED
,VERIFIED
,DISCONNECTED_VERIFIED
,PENDING
CONNECTED
state (that is, with an unverified Uphold wallet):PENDING
)VERIFIED
state), we need a state migrationStateMigrationV10
Get Wallet
) client to be able to tell if the wallet is linked according to Rewards servicesRewardsStateBrowserTest/UpholdStateMachine.Migration/*
)authorization flow
:authorization flow
:generate wallet
flowgenerate wallet
flow:UpholdCard
anon_transfer_checked
: in the old state machine, it might have made sense to try to save an API call on transferring the anon funds when the wallet was in theVERIFIED
state (because the wallet was already verified, so why would we have initiated the anon funds transfer process). In the new state machine, however, if the wallet is in theVERIFIED
state, we don't even get to the point where we would transfer the anon funds again, so keeping track of whether we have already done it, doesn't really make much sense.fetch balance
flow:fetch balance
flow returned0.0
if the Uphold wallet status wasCONNECTED
, now it returns0.0
if it's notVERIFIED
Error: BAT unavailable
:Error: Blocked account
:Error: Pending account
:Error: Restricted account
:There are a couple of issues to address:
generate wallet
flows running at the same time - not concurrently, but can have their subtasks interleaved)PENDING
state (show different error states to the user, that is, why the wallet is in thePENDING
state) - the currentPENDING
state UI does not sufficePENDING
state by manually disconnectingCONNECTED
or theDISCONNECTED_NOT_VERIFIED
state into valid states in the new state machine (since these states are being removed) and those, too, who transitioned to theVERIFIED
state incorrectly (e.g. semi-VERIFIED
state), or transitioned into an inconsistent state (e.g.VERIFIED
, butuphold_wallet->token.empty() || uphold_wallet->address.empty()
)StateMigrationV10
authorization flow
generate wallet flow
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Regression testing on Uphold use-cases.