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

chore(IT Wallet): [SIW-1830] Wallet errors refactor #6455

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

Conversation

gispada
Copy link
Collaborator

@gispada gispada commented Nov 25, 2024

Short description

This PR refactors how errors are handled in ITW flows following the refactor in io-react-native-wallet. Now it's possible to differentiate between issuer and wallet provider errors.

List of changes proposed in this pull request

  • Updated io-react-native-wallet to 0.25.0 (as a side-effect of this update, the integrity key tag is now needed to revoke the wallet instance)
  • Updated several lines to use the new errors exported by io-react-native-wallet
  • Improved typing of the reason property in ITW failure screens. Known reason types must be declared, in order to avoid unkown reasons as much as possible.
  • Added WALLET_PROVIDER_GENERIC and UNEXPECTED failures

Mixpanel

  • Extracted the logic to track Mixpanel events into separate React hooks.
  • Created ITW_ADD_CREDENTIAL_UNEXPECTED_FAILURE Mixpanel event to track unexpected errors that occur during credential issuance, to be consistent with ITW_ID_REQUEST_UNEXPECTED_FAILURE
  • Added caused_by property to ITW_ADD_CREDENTIAL_FAILURE and ITW_ID_REQUEST_FAILURE

How to test

  • Activate IT Wallet and mock HTTP errors from both the wallet provider and the issuer.
  • Get a credential and mock HTTP errors from the issuer.
  • Mock 404 HTTP errors from the /status endpoint

@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Nov 25, 2024

Affected stories

  • ⚙️ SIW-1830: [io-app] Adattare la gestione degli errori alle modifiche introdotte dal refactor di io-react-native-wallet
    subtask of
    • SIW-1463: Refactor e Debito Tecnico

Generated by 🚫 dangerJS against 216c273

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 22.14286% with 109 lines in your changes missing coverage. Please review.

Project coverage is 48.08%. Comparing base (4f204b4) to head (216c273).
Report is 795 commits behind head on master.

Files with missing lines Patch % Lines
...nce/screens/ItwIssuanceCredentialFailureScreen.tsx 10.00% 27 Missing ⚠️
...t/issuance/screens/ItwIssuanceEidFailureScreen.tsx 4.00% 24 Missing ⚠️
...llet/issuance/hooks/useCredentialEventsTracking.ts 5.00% 19 Missing ⚠️
...es/itwallet/issuance/hooks/useEidEventsTracking.ts 6.25% 15 Missing ⚠️
ts/features/itwallet/machine/eid/actors.ts 0.00% 6 Missing ⚠️
ts/features/itwallet/machine/eid/guards.ts 0.00% 5 Missing ⚠️
...dentials/saga/checkCredentialsStatusAttestation.ts 25.00% 3 Missing ⚠️
ts/features/itwallet/machine/credential/failure.ts 72.72% 3 Missing ⚠️
ts/features/itwallet/machine/eid/failure.ts 75.00% 3 Missing ⚠️
ts/features/itwallet/analytics/index.ts 75.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6455      +/-   ##
==========================================
- Coverage   48.42%   48.08%   -0.34%     
==========================================
  Files        1488     1631     +143     
  Lines       31617    32736    +1119     
  Branches     7669     7511     -158     
==========================================
+ Hits        15311    15742     +431     
- Misses      16238    16937     +699     
+ Partials       68       57      -11     
Files with missing lines Coverage Δ
...ommon/utils/itwCredentialStatusAttestationUtils.ts 65.00% <100.00%> (ø)
...let/lifecycle/saga/checkWalletInstanceStateSaga.ts 100.00% <100.00%> (ø)
ts/features/itwallet/analytics/index.ts 31.81% <75.00%> (ø)
...features/itwallet/common/utils/itwIssuanceUtils.ts 20.31% <0.00%> (ø)
...atures/itwallet/common/utils/itwRevocationUtils.ts 25.00% <0.00%> (ø)
ts/features/itwallet/machine/eid/machine.ts 92.00% <0.00%> (ø)
...dentials/saga/checkCredentialsStatusAttestation.ts 5.55% <25.00%> (ø)
ts/features/itwallet/machine/credential/failure.ts 66.66% <72.72%> (ø)
ts/features/itwallet/machine/eid/failure.ts 73.68% <75.00%> (ø)
ts/features/itwallet/machine/eid/guards.ts 9.52% <0.00%> (ø)
... and 5 more

... and 1676 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 bb7e753...216c273. Read the comment docs.

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