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

feat: [IOPID-2322] - CieID Error handling #6306

Merged
merged 29 commits into from
Oct 28, 2024
Merged

Conversation

ChrisMattew
Copy link
Collaborator

@ChrisMattew ChrisMattew commented Oct 18, 2024

Short description

Added error and loading handling

List of changes proposed in this pull request

  • Updated scripts cie-ios:prod and cie-ios:dev
  • Replaced the default react-native-webview loader with the LoadingOverlay component in the renderLoading method
  • Configured onHttpError and onError to use handleLoadingError function
  • Added isAuthenticationUrl utility function to detect when to open the CieID app
  • Added handleLoginFailure function to properly redirect to the AuthErrorScreen
  • Added 4 dedicated errors in the AuthErroComponent

Demo

iOS

Operation canceled

NFC Available NFC not available From Deep Link
iOS-cancel-operation-cie-pin-available.mp4
iOS-cancel-operation-cie-pin-unavailable.mp4
iOS-deep-link-operation-cancel.mp4

Invalid operation

From Deep Link
iOS-invalid-operation.mp4
Android

Operation canceled

NFC Available NFC not available App2App
android-cie-id-operation-interrupted-cie-pin-available.mp4
android-cie-id-operation-interrupted-cie-pin-not-available.mp4
android-cie-id-operation-cancel.mp4

How to test

Run the app in the local environment, and emulate what shown in the Demo videos

Important

Currently, the following errors are expected:

Android

  • CIEID_OPERATION_CANCEL: Currently handled only on Android in the production environment.

iOS (Deep link)

  • Operation canceled
  • Operation invalid

Both platforms

Clicking the "Cancel" CTA during the loading of the login screen.

@pagopa-github-bot pagopa-github-bot changed the title [IOPID-2322] - CieID Error handling feat: [IOPID-2322] - CieID Error handling Oct 18, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 18, 2024

Affected stories

  • 🌟 IOPID-2322: [APP] Integrazione in app del loading con CTA ed errori durante la login con CieID
    subtask of

Generated by 🚫 dangerJS against 667884a

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 19.67213% with 49 lines in your changes missing coverage. Please review.

Project coverage is 47.06%. Comparing base (4f204b4) to head (667884a).
Report is 643 commits behind head on master.

Files with missing lines Patch % Lines
...features/cieLogin/components/CieIdLoginWebView.tsx 11.11% 40 Missing ⚠️
ts/screens/authentication/AuthErrorScreen.tsx 11.11% 8 Missing ⚠️
ts/hooks/useNavigateToLoginMethod.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6306      +/-   ##
==========================================
- Coverage   48.42%   47.06%   -1.36%     
==========================================
  Files        1488     1808     +320     
  Lines       31617    36781    +5164     
  Branches     7669     8785    +1116     
==========================================
+ Hits        15311    17312    +2001     
- Misses      16238    19413    +3175     
+ Partials       68       56      -12     
Files with missing lines Coverage Δ
...s/features/cie/screens/errors/CieIdErrorScreen.tsx 100.00% <100.00%> (ø)
ts/features/cieLogin/utils/index.ts 71.42% <100.00%> (-28.58%) ⬇️
ts/screens/authentication/IdpLoginScreen.tsx 1.94% <ø> (-2.06%) ⬇️
...s/authentication/components/AuthErrorComponent.tsx 84.61% <ø> (ø)
...s/screens/authentication/idpAuthSessionHandler.tsx 4.62% <ø> (-0.05%) ⬇️
ts/hooks/useNavigateToLoginMethod.tsx 39.47% <0.00%> (ø)
ts/screens/authentication/AuthErrorScreen.tsx 12.50% <11.11%> (ø)
...features/cieLogin/components/CieIdLoginWebView.tsx 13.25% <11.11%> (ø)

... and 1426 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 83be5c4...667884a. Read the comment docs.

@mariateresaventura
Copy link
Contributor

@mariateresaventura copy review needed 🙏🏻

Done!

Copy link
Contributor

@Ladirico Ladirico left a comment

Choose a reason for hiding this comment

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

LGTM!

@Ladirico Ladirico merged commit a587d86 into master Oct 28, 2024
13 checks passed
@Ladirico Ladirico deleted the IOPID-2322-cie-id-errors branch October 28, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-A&I IO - Autenticazione e Identità
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants