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

[SIW-1455] Reissuing expired or expiring eID #6580

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

RiccardoMolinari95
Copy link
Collaborator

@RiccardoMolinari95 RiccardoMolinari95 commented Dec 24, 2024

Short description

This PR handle the reissuing of eID when it is expired or expiring and manages credential requests when the eID is expired, and the Wallet Instance is invalid

List of changes proposed in this pull request

  • Add a cta in ItwEidLifecycleAlertto start eID reissuing, navigating to ItwIdentificationModeSelectionScreen with param eidReissuing set to true
  • Add an optional parameter eidReissuing to ItwIdentificationModeSelectionScreen, if present send the start-reissuing event to itwEidIssuanceMachine
  • Created a new screen ItwPresentationEidVerificationExpiredScreen, displayed when requesting a credential with the expired eID and a not valid Wallet Instance
  • Navigate to ItwPresentationEidVerificationExpiredScreen in WalletCardOnboardingScreen requesting a credential but the Wallet Instance is not valid
  • In itwEidIssuanceMachinecreated a new action setIsReissuing to set the isReissuing context state to true, and added a new guard isReissuing to check if we are in the reissuing scenario.
    Added the start-reissuing event to the Idle state, allowing a direct transition to the UserIdentification state. Enhanced the UserIdentification state to handle the back button differently based on whether the flow is in the reissuing scenario or not. Updated the DisplayingPreview state to handle reissuing. If isReissuing is true, it navigates directly to the wallet; otherwise, it transitions to the Success state

How to test

To test the changes, simulate different scenarios by mocking the jwt.expiration of the stored eID credential: request the eID when it is expiring or expired, and attempt to request a credential with an expired eID and an invalid Wallet Instance, ensuring the correct screens and flows are triggered

Requesting credential with WI invalid and eID expired

Screen.Recording.2024-12-24.at.10.50.05.mov

Reissuing expiring eID (same flow for expired eID)

Screen.Recording.2024-12-24.at.10.38.58.mov

@RiccardoMolinari95 RiccardoMolinari95 self-assigned this Dec 24, 2024
@RiccardoMolinari95 RiccardoMolinari95 marked this pull request as draft December 24, 2024 09:54
@RiccardoMolinari95 RiccardoMolinari95 changed the title [SIW-1455] eID re-issuing when jwt is expiring or expired [SIW-1455] Reissuing Expired or Expiring eID Dec 24, 2024
Copy link
Contributor

github-actions bot commented Dec 24, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue SIW-1455

Copy link

codecov bot commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 35.29412% with 22 lines in your changes missing coverage. Please review.

Project coverage is 49.59%. Comparing base (93bd0a8) to head (69c0547).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/itwallet/machine/credential/guards.ts 10.00% 9 Missing ⚠️
...ns/ItwPresentationEidVerificationExpiredScreen.tsx 12.50% 7 Missing ⚠️
ts/features/itwallet/machine/credential/actions.ts 0.00% 2 Missing ⚠️
ts/features/itwallet/machine/eid/machine.ts 60.00% 2 Missing ⚠️
...twallet/common/components/ItwEidLifecycleAlert.tsx 66.66% 1 Missing ⚠️
...n/screens/ItwIdentificationModeSelectionScreen.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6580      +/-   ##
==========================================
- Coverage   49.61%   49.59%   -0.02%     
==========================================
  Files        1564     1565       +1     
  Lines       32370    32393      +23     
  Branches     7332     7290      -42     
==========================================
+ Hits        16059    16065       +6     
- Misses      16263    16291      +28     
+ Partials       48       37      -11     
Files with missing lines Coverage Δ
...common/components/ItwEidInfoBottomSheetContent.tsx 70.83% <ø> (ø)
ts/features/itwallet/machine/credential/machine.ts 92.30% <ø> (-0.55%) ⬇️
ts/features/itwallet/machine/eid/actions.ts 1.49% <ø> (ø)
ts/features/itwallet/machine/eid/context.ts 100.00% <ø> (ø)
...features/itwallet/navigation/ItwStackNavigator.tsx 36.36% <ø> (ø)
ts/features/itwallet/navigation/routes.ts 100.00% <ø> (ø)
...eatures/wallet/components/WalletCardsContainer.tsx 100.00% <ø> (ø)
...twallet/common/components/ItwEidLifecycleAlert.tsx 84.21% <66.66%> (-4.03%) ⬇️
...n/screens/ItwIdentificationModeSelectionScreen.tsx 79.41% <83.33%> (+0.10%) ⬆️
ts/features/itwallet/machine/credential/actions.ts 0.00% <0.00%> (ø)
... and 3 more

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93bd0a8...69c0547. Read the comment docs.

context.failure?.type === CredentialIssuanceFailureType.INVALID_STATUS,

isSkipNavigation: ({ event }: { event: CredentialIssuanceEvents }) =>
isSelectCredentialEvent(event) && event.skipNavigation === true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be simplified:

Suggested change
isSelectCredentialEvent(event) && event.skipNavigation === true,
event.type === "select-credential" && event.skipNavigation === true,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants