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-1780] Use errors in issuance_errors_supported when issuing credentials #6338

Merged
merged 13 commits into from
Oct 31, 2024

Conversation

gispada
Copy link
Collaborator

@gispada gispada commented Oct 28, 2024

Short description

This PR adds more meaningful errors during the issuance of credentials when a credential is invalid. These errors messages are extracted from the entity configuration via a utility function exposed by io-react-native-wallet.

List of changes proposed in this pull request

  • Added new INVALID_STATUS failure type
  • Removed NOT_ENTITLED because it can be represented with INVALID_STATUS
  • Display the dynamic error message of an INVALID_STATUS failure
  • Added new Mixpanel event

How to test

Try to get a credential and use a proxy to mock the /credential endpoint response:

  • Modify the status code to 403 or 404
  • Modify the response body with { "error": "credential_not_found" } or another error code found in the EC's issuance_errors_supported
  • Ensure the corresponding error message is displayed in the error screen

Copy link

dpulls bot commented Oct 28, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

@gispada gispada changed the title chore(IT Wallet): [SiW-1780] Show issuance_errors_supported in the issuance of credentials chore(IT Wallet): [SiW-1780] Use errors in issuance_errors_supported when issuing credentials Oct 28, 2024
@gispada gispada changed the title chore(IT Wallet): [SiW-1780] Use errors in issuance_errors_supported when issuing credentials chore(IT Wallet): [SIW-1780] Use errors in issuance_errors_supported when issuing credentials Oct 28, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 28, 2024

Affected stories

  • ⚙️ SIW-1780: [io-app] Gestire gli errori di stato delle credenziali in fase di ottenimento

Generated by 🚫 dangerJS against ce1e44e

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

4 similar comments
Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

@gispada gispada requested review from freddi301 and a team as code owners October 29, 2024 16:08
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 16.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 47.00%. Comparing base (4f204b4) to head (ce1e44e).
Report is 662 commits behind head on master.

Files with missing lines Patch % Lines
...nce/screens/ItwIssuanceCredentialFailureScreen.tsx 5.55% 17 Missing ⚠️
ts/features/itwallet/analytics/index.ts 33.33% 2 Missing ⚠️
...dentials/saga/checkCredentialsStatusAttestation.ts 0.00% 1 Missing ⚠️
ts/features/itwallet/machine/credential/failure.ts 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6338      +/-   ##
==========================================
- Coverage   48.42%   47.00%   -1.42%     
==========================================
  Files        1488     1815     +327     
  Lines       31617    36913    +5296     
  Branches     7669     8780    +1111     
==========================================
+ Hits        15311    17352    +2041     
- Misses      16238    19504    +3266     
+ Partials       68       57      -11     
Files with missing lines Coverage Δ
...dentials/saga/checkCredentialsStatusAttestation.ts 0.00% <0.00%> (ø)
ts/features/itwallet/machine/credential/failure.ts 76.47% <66.66%> (ø)
ts/features/itwallet/analytics/index.ts 29.06% <33.33%> (ø)
...nce/screens/ItwIssuanceCredentialFailureScreen.tsx 6.12% <5.55%> (ø)

... and 1438 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 a2d0715...ce1e44e. Read the comment docs.

Copy link

dpulls bot commented Oct 29, 2024

⚠️ Dpulls not installed on repository pagopa/io-react-native-wallet. Checkout our quickstart for how to install.

Copy link
Contributor

@mastro993 mastro993 left a comment

Choose a reason for hiding this comment

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

LGTM

@mastro993 mastro993 merged commit 4430746 into master Oct 31, 2024
13 checks passed
@mastro993 mastro993 deleted the SIW-1780-credential-status-error-during-issuance branch October 31, 2024 16:29
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