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-1933] Handle Trustmark QR code generation failures #6558

Merged
merged 19 commits into from
Jan 9, 2025

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Dec 17, 2024

Short description

This PR adds the handling of Trustmark generation failures in the Trustmark QR Code screen

List of changes proposed in this pull request

  • Added failure alert if QR Code generation fails
  • Added the ability to retry the QR Code generation with an exponential backoff timer
  • Updated tests

How to test

From the details screen of a credential, tap on the Trustmark button, check that everything works as expected.

Tip

You can make the Trustmark generation fail by mocking the getCredentialTrustmarkActor function and make it throw

Ensure that when the Trustmark generation fails, the screens shows an error alert with a "Retry" button.
If you try to press the "Retry" button repeatedly, you should get an error toast telling you to wait a few seconds before trying to get the trustmark again.

Preview

@mastro993 mastro993 self-assigned this Dec 17, 2024
@pagopa-github-bot pagopa-github-bot changed the title [SIW-1933] Handle Trustmark QR code generation failures chore(IT Wallet): [SIW-1933] Handle Trustmark QR code generation failures Dec 17, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Dec 17, 2024

Affected stories

  • ⚙️ SIW-1933: [io-app] Gestire errori generazione QR Code trustmark

Generated by 🚫 dangerJS against dcc41ad

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Jira Pull Request Link

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

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 27.69231% with 47 lines in your changes missing coverage. Please review.

Project coverage is 49.30%. Comparing base (22ca3e6) to head (aa73944).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/itwallet/trustmark/machine/actions.ts 0.00% 17 Missing ⚠️
...wallet/trustmark/components/ItwTrustmarkQrCode.tsx 15.38% 11 Missing ⚠️
...ustmark/components/ItwTrustmarkExpirationTimer.tsx 9.09% 10 Missing ⚠️
ts/store/reducers/debug.ts 25.00% 3 Missing ⚠️
ts/features/itwallet/trustmark/machine/actors.ts 0.00% 2 Missing ⚠️
ts/features/itwallet/trustmark/machine/failure.ts 75.00% 2 Missing ⚠️
ts/features/itwallet/trustmark/machine/machine.ts 85.71% 1 Missing ⚠️
...s/features/itwallet/trustmark/machine/provider.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6558      +/-   ##
==========================================
+ Coverage   47.96%   49.30%   +1.33%     
==========================================
  Files        1555     1565      +10     
  Lines       32141    32223      +82     
  Branches     7273     7292      +19     
==========================================
+ Hits        15416    15887     +471     
+ Misses      16688    16298     -390     
- Partials       37       38       +1     
Files with missing lines Coverage Δ
ts/components/QrCodeImage.tsx 80.00% <100.00%> (ø)
...et/trustmark/components/ItwCredentialTrustmark.tsx 20.96% <ø> (ø)
...s/features/itwallet/trustmark/machine/selectors.ts 60.00% <100.00%> (+10.00%) ⬆️
...trustmark/screens/ItwCredentialTrustmarkScreen.tsx 25.00% <ø> (-1.67%) ⬇️
ts/features/itwallet/trustmark/utils/index.ts 100.00% <ø> (ø)
ts/features/itwallet/trustmark/machine/machine.ts 78.94% <85.71%> (+3.94%) ⬆️
...s/features/itwallet/trustmark/machine/provider.tsx 25.00% <0.00%> (-3.58%) ⬇️
ts/features/itwallet/trustmark/machine/actors.ts 7.14% <0.00%> (+0.89%) ⬆️
ts/features/itwallet/trustmark/machine/failure.ts 75.00% <75.00%> (ø)
ts/store/reducers/debug.ts 61.90% <25.00%> (-10.32%) ⬇️
... and 3 more

... and 53 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 22ca3e6...aa73944. Read the comment docs.

Copy link
Collaborator

@gispada gispada 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 added this pull request to the merge queue Jan 9, 2025
Merged via the queue into master with commit b207270 Jan 9, 2025
21 checks passed
@mastro993 mastro993 deleted the SIW-1933-handle-trustmark-qr-code-errors branch January 9, 2025 16:17
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