Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-1854] Route every unsupported device error code (
Browse files Browse the repository at this point in the history
#6452)

## Short description
This PR adds routing of all analyzed error codes that need to be mapped
to unsupported device

## List of changes proposed in this pull request
- Routed every error code coming from external libraries such as
[crypto](https://github.com/pagopa/io-react-native-crypto) and
[integrity](https://github.com/pagopa/io-react-native-integrity) that
needs to be pointed to unsupported device screen

## How to test
Try to manipulate some error response obtaining error codes tracked on
this
[analysis](https://pagopa.atlassian.net/wiki/spaces/SIW/pages/1387299065/REPORT-006+Analisi+su+messaggi+di+errore+dalle+librerie+io-react-native-crypto+e+io-react-native-integrity+per+mappare+eventuali+errori+nella+casistica+dispositivo+non+supportato).
  • Loading branch information
ale-mazz authored Nov 26, 2024
1 parent 113d171 commit 9d8f0e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ts/features/itwallet/machine/eid/failure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
type IntegrityError,
type IntegrityErrorCodes
} from "@pagopa/io-react-native-integrity";
import { CryptoErrorCodes } from "@pagopa/io-react-native-crypto";
import { assert } from "../../../../utils/assert";
import { EidIssuanceEvents } from "./events";

Expand Down Expand Up @@ -59,11 +60,16 @@ export const mapEventToFailure = (
* Integrity errors thrown by the device.
* These errors might occur locally before calling the Wallet Provider.
*/
const localIntegrityErrors: Array<IntegrityErrorCodes> = [
const localIntegrityErrors: Array<IntegrityErrorCodes | CryptoErrorCodes> = [
"REQUEST_ATTESTATION_FAILED",
"UNSUPPORTED_DEVICE",
"UNSUPPORTED_IOS_VERSION",
"UNSUPPORTED_SERVICE"
"UNSUPPORTED_SERVICE",
"WRONG_KEY_CONFIGURATION",
"API_LEVEL_NOT_SUPPORTED",
"PREPARE_FAILED",
"KEY_IS_NOT_HARDWARE_BACKED",
"GENERATION_KEY_FAILED"
];

const isLocalIntegrityError = (e: unknown): e is IntegrityError =>
Expand Down

0 comments on commit 9d8f0e1

Please sign in to comment.