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

[#172076080] Added delay between incorrect pin insertion attempts #1711

Merged
merged 37 commits into from
May 13, 2020

Conversation

fabriziofff
Copy link
Contributor

@fabriziofff fabriziofff commented Apr 21, 2020

Short description:
This pr changes the behaviour of the identification phase when too many wrong attempts are made.
The new behavior follows the following rules:

  • From 1st to 4th attempt: no delay between attempts.
  • 5th attempt: introduce a delay of 30 sec before try again.
  • 6th attempt: introduce a delay of 60 sec before try again.
  • 7th attempt: introduce a delay of 90 sec before try again.
  • 8th attempt: generate an application logout and the authentication is required again.

Wrong attempts sequence:

Hard logout after last try:

List of changes proposed in this pull request:

  • Added IdentificationLockModal displayed to lock the application during the waiting phase.
  • Changed IdentificationModal to support the new logic.
  • Changed PinPad to support the rendering of the "remaining attempts block"
  • Added identificationFailure action to Identification Actions to model the new action of failure of pin insertion.
  • Modified the store for the identification section, adding two separate sub-sections: progress containing all the information on the identification "state" and fail containing all the information related to the fail pin data. The fail section is now persisted.
  • Changed ts/store/reducers/identification.ts to support the new actions and store.
  • Changed ts/sagas/identification.ts to support the forceLogout action.
  • Changed ts/store/transforms/dateISO8601Tranform.ts to support the serialization of a Date for the store identification.fail.nextLegalAttempt. [TODO: in this phase I've just added the rules to serialize the fields as data, in the future could be a good idea to change the file in order to support in a generic and parametric way the serialization of a generic field]

How to test:
When a pin is requested (application open or payment) insert a wrong pin multiple time.

@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Apr 21, 2020

Affected stories

  • 🌟 #172076080: [PAPI164101] come CIT se inserisco il PIN errato o fallisco l'autenticazione biometrica ho un limite massimo di tentativi

Generated by 🚫 dangerJS

@fabriziofff fabriziofff marked this pull request as ready for review April 22, 2020 09:22
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
ts/screens/modal/IdentificationLockModal.tsx Outdated Show resolved Hide resolved
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
ts/components/Pinpad/index.tsx Show resolved Hide resolved
locales/it/index.yml Outdated Show resolved Hide resolved
ts/store/reducers/identification.ts Show resolved Hide resolved
ts/store/transforms/dateISO8601Tranform.ts Outdated Show resolved Hide resolved
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
ts/IdentificationModal.tsx Outdated Show resolved Hide resolved
wrongCode: Codice errato
remainingAttempts: Ti rimangono {{attempts}} tentativi.
remainingAttemptSingle: Ti rimane {{attempts}} tentativo.
tooManyAttempts: Troppi tentativi di inserimento errati.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tooManyAttempts: Troppi tentativi di inserimento errati.
tooManyAttempts: Hai esaurito i tentativi di inserimento del tuo Codice di sblocco.

According to the mockup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

waiting for the updated text to complete this part.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The text has not changed, it is the same as it was at the beginning ("Hai esaurito i tentativi di inserimento del tuo codice di sblocco" is not true).

Copy link
Contributor

Choose a reason for hiding this comment

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

@fabriziofff are you sure? I check it right now and I see
tooManyAttempts: Troppi tentativi di inserimento errati.
It is also listed here in files changes
I checked it on this commit 9591067

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was talking about the invision file and the texts. In the last sprint review we agreed on a textual review because neither my change "Troppi tentativi di inserimento errati" nor "Hai esaurito i tentativi di inserimento del tuo codice di sblocco" were good and I was waiting for the updated version.
if the review is no longer needed, I can change it immediately with the first version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I completely removed it from my mind!
Since this is a minor change we can update it in another stor/PR

remainingAttempts: Ti rimangono {{attempts}} tentativi.
remainingAttemptSingle: Ti rimane {{attempts}} tentativo.
tooManyAttempts: Troppi tentativi di inserimento errati.
waitMessage: "Riprova tra:"
Copy link
Contributor

@Undermaken Undermaken May 6, 2020

Choose a reason for hiding this comment

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

Suggested change
waitMessage: "Riprova tra:"
waitMessage: "Chiudi l’applicazione o riprova tra:"

I guess this message could be more appropriate. (sorry for the rollback 😈)
Isn't it?

wrongCode: Codice errato
remainingAttempts: Ti rimangono {{attempts}} tentativi.
remainingAttemptSingle: Ti rimane {{attempts}} tentativo.
tooManyAttempts: Troppi tentativi di inserimento errati.
Copy link
Contributor

Choose a reason for hiding this comment

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

) {
this.maybeTriggerFingerprintRequest({
updateBiometrySupportProp:
prevProps.appState !== "active" && this.props.appState === "active"
});
}

const previousAttempts = prevProps.identificationFailState
Copy link
Contributor

Choose a reason for hiding this comment

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

Since it could have or not a value, could be this statement more expressive?

prevProps.identificationFailState.fold(
      undefined,
      s => s.remainingAttempts
    );

@Undermaken Undermaken merged commit eb86a36 into master May 13, 2020
@Undermaken Undermaken deleted the 172076080-insert-delay-between-wrong-pin-try branch May 13, 2020 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants