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-1639] Show error banner when wallet instance status check fails #6568

Merged
merged 23 commits into from
Jan 8, 2025

Conversation

gispada
Copy link
Collaborator

@gispada gispada commented Dec 18, 2024

Short description

This PR handles unexpected failures during the request to fetch the Wallet Instance status. When it is not possible to determine the status, the Wallet will not be available.

List of changes proposed in this pull request

  • Created ItwWalletNotAvailableBanner component
  • Turned itWallet.walletInstance.status into a pot for better async handling (+ store migration)
  • Hide ItwWalletReadyBanner and ItwWalletCardsContainer when the Wallet Instance status call failed

How to test

  • Get a wallet instance, then fake an error in api/v1/wallet/wallet-instances/<wallet_instance_id>/status: you should see the following screen

Regression tests:

  • Get a wallet instance and restart the app: everything should work as before
  • Get a wallet instance, then revoke it: everything should work as before (with an alert only shown once)

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Jira Pull Request Link

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

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 61.76471% with 13 lines in your changes missing coverage. Please review.

Project coverage is 49.28%. Comparing base (ecd87bc) to head (be4a323).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...es/itwallet/walletInstance/store/reducers/index.ts 18.18% 9 Missing ⚠️
.../common/components/ItwWalletNotAvailableBanner.tsx 85.71% 1 Missing ⚠️
.../features/itwallet/common/store/selectors/index.ts 0.00% 1 Missing ⚠️
...let/lifecycle/saga/checkWalletInstanceStateSaga.ts 80.00% 1 Missing ⚠️
ts/features/wallet/store/selectors/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6568      +/-   ##
==========================================
- Coverage   49.28%   49.28%   -0.01%     
==========================================
  Files        1558     1559       +1     
  Lines       32156    32179      +23     
  Branches     7325     7332       +7     
==========================================
+ Hits        15849    15860      +11     
- Misses      16258    16269      +11     
- Partials       49       50       +1     
Files with missing lines Coverage Δ
...stance/hook/useItwWalletInstanceRevocationAlert.ts 85.71% <100.00%> (ø)
...res/itwallet/walletInstance/store/actions/index.ts 100.00% <100.00%> (ø)
...s/itwallet/walletInstance/store/selectors/index.ts 75.00% <100.00%> (+8.33%) ⬆️
...eatures/wallet/components/WalletCardsContainer.tsx 100.00% <100.00%> (ø)
.../common/components/ItwWalletNotAvailableBanner.tsx 85.71% <85.71%> (ø)
.../features/itwallet/common/store/selectors/index.ts 80.00% <0.00%> (-5.72%) ⬇️
...let/lifecycle/saga/checkWalletInstanceStateSaga.ts 91.66% <80.00%> (-8.34%) ⬇️
ts/features/wallet/store/selectors/index.ts 91.48% <66.66%> (-1.70%) ⬇️
...es/itwallet/walletInstance/store/reducers/index.ts 52.00% <18.18%> (-23.00%) ⬇️

... and 1 file 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 8ed401c...be4a323. Read the comment docs.

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

@gispada gispada added this pull request to the merge queue Jan 8, 2025
Merged via the queue into master with commit b490c39 Jan 8, 2025
21 checks passed
@gispada gispada deleted the SIW-1639-wallet-instance-status-failure branch January 8, 2025 15:47
LazyAfternoons pushed a commit that referenced this pull request Jan 9, 2025
…tatus check fails (#6568)

## Short description
This PR handles unexpected failures during the request to fetch the
Wallet Instance status. When it is not possible to determine the status,
the Wallet will not be available.

## List of changes proposed in this pull request
- Created `ItwWalletNotAvailableBanner` component
- Turned `itWallet.walletInstance.status` into a pot for better async
handling (+ store migration)
- Hide `ItwWalletReadyBanner` and `ItwWalletCardsContainer` when the
Wallet Instance status call failed

## How to test
- Get a wallet instance, then fake an error in
`api/v1/wallet/wallet-instances/<wallet_instance_id>/status`: you should
see the following screen

Regression tests:
- Get a wallet instance and restart the app: everything should work as
before
- Get a wallet instance, then revoke it: everything should work as
before (with an alert only shown once)

<img
src="https://github.com/user-attachments/assets/cf8d36d0-0fad-4e5e-a4a8-80b75ce3c72b"
width="240" />
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.

2 participants