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

[Wallet] Fix account timeout issue during verification #5656

Merged
merged 14 commits into from
Nov 5, 2020

Conversation

i1skn
Copy link
Contributor

@i1skn i1skn commented Oct 31, 2020

Description

  • Increase account unlock timeout to 10 minutes to fix referenced issue.
  • Re-unlock account before verification start, so give at least 10 min guaranteed to a user to verify. It will also do it on resend messages.

Other changes

Fix issue, when last confirmed attestation code is become empty after it is confirmed.

Tested

Verification flow done

Related issues

Backwards compatibility

Yes

@i1skn i1skn force-pushed the i1skn/fix-unlock-timeout branch from 8aa2054 to 1f0318a Compare November 4, 2020 16:18
@i1skn i1skn force-pushed the i1skn/fix-unlock-timeout branch from 1f0318a to a063e79 Compare November 4, 2020 16:21
@i1skn i1skn marked this pull request as ready for review November 4, 2020 16:26
@i1skn i1skn changed the title I1skn/fix unlock timeout [Wallet] Fix account timeout issue during verification Nov 4, 2020
Copy link
Contributor

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I see no tests were updated for this, can you add some to make sure this doesn't break in the future?

Comment on lines +95 to +99
// Lock and ask user for a PIN because we
// want to reset timeout for unlocked account
clearPasswordCaches()
yield call(unlockAccount, account, true)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the user to be asked for their PIN when starting verification, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap 🙂

@@ -200,7 +200,7 @@ export const reducer = (
case Actions.COMPLETE_ATTESTATION_CODE:
return {
...state,
...completeCodeReducer(state, state.numCompleteAttestations + 1),
numCompleteAttestations: state.numCompleteAttestations + 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed because completeCodeReducer should be used only for the case when we set completed codes initially. We can not use it here, because on this line

attestationCodes[i] = acceptedAttestationCodes[i] || {
we would assign to attestationCodes[i] undefined yet acceptedAttestationCodes[i], which will be defined after this reducer is finishes.

@i1skn
Copy link
Contributor Author

i1skn commented Nov 4, 2020

@jeanregisser I have addressed the feedback! PTAL

Copy link
Contributor

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 👍

@jeanregisser jeanregisser added the automerge Have PR merge automatically when checks pass label Nov 5, 2020
@mergify mergify bot merged commit 7018c27 into master Nov 5, 2020
@mergify mergify bot deleted the i1skn/fix-unlock-timeout branch November 5, 2020 15:51
mergify bot pushed a commit that referenced this pull request Nov 5, 2020
### Description

#5656 has introduced mandatory enter of PIN code while onboarding flow to prevent account unlock timeout issue.

This PR would disable it specifically to the initial onboarding (we hope that 10 minutes since user sets the PIN would be enough to finish onboarding initially) and keep it if user comes back to verification later. 

### Caveat
The only one I see is when user goes to verification from Home screen, enters PIN, press Start/Resume, press back, user again needs to enter a PIN code. Not sure how often this is happening and to which extent it would ruin the UX.

### Tested

Initial onboarding with verification and return to verification flow later.

### Backwards compatibility

Yes
@Lss-Ankit
Copy link

@jeanregisser Verified task using Test flight build v1.4.0 (28) and Android play store (internal build) v1.4.0 (1004294317) and found that user is able to complete phone number verification flow with out facing any verification failed pop up.

Verified on : iPhone XR (13.2.2) and Google Pixel XL (8.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass wallet
Projects
None yet
3 participants