chore(IT-Wallet): [SIW-4952] Handle suspended status from TSL, update status playground to support TSL - #8550
Merged
Merged
Conversation
Contributor
PR Title Validation for conventional commit type✅ All good! PR title follows the conventional commit type. |
Contributor
Jira Pull Request LinkThis Pull Request refers to Jira issues: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8550 +/- ##
=======================================
Coverage 65.24% 65.25%
=======================================
Files 2027 2027
Lines 38627 38629 +2
Branches 6585 6586 +1
=======================================
+ Hits 25204 25206 +2
Misses 11991 11991
Partials 1432 1432
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…ma` (#8544) ## Short description This PR refactors the `jsonFetchToSchema` utility and its usage across the authentication feature to use the neverthrow `Result` type. This replaces the custom { ok, data, error } object wrapper. ## List of changes proposed in this pull request - Replaces the custom `AsyncResult` type with `neverthrow`'s `Result`, adds a helper `parseWithSchema` for schema validation and updates the function to return `ok`/`err` results throughout. - Updates all tests - Updates handling of the result from `jsonFetchToSchema` to use `isErr()`/`value` instead of `ok`/`data`. ## How to test Verify that all tests pass.
## Short description Remove unused components and hooks from the codebase. ## List of changes proposed in this pull request - Remove files that aren't referenced anymore ## How to test Check that the deleted files are not actually being used anywhere. --------- Co-authored-by: Cristiano Tofani <cristiano.tofani@pagopa.it>
## Short description Remove or de-export unused types. ## List of changes proposed in this pull request - Remove dead types, not referenced anymore - De-export the ones effectively used in the module ## How to test Describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
…RCODE_SCAN_SUCCESS (#8546) ## Short description Adds the correct analytics `code` value when a credential offer QR code is successfully scanned. ## List of changes proposed in this pull request - Map `ITW_CREDENTIAL_OFFER` to `"ITW aggiunta documento"` in the `QRCODE_SCAN_SUCCESS` event. - Add test coverage for the new analytics mapping and event properties. ## How to test 1. Scan an IT-Wallet credential offer QR code. 2. Verify that `QRCODE_SCAN_SUCCESS` is tracked with: ```json { "code": "ITW aggiunta documento", "data_entry": "qr code", "flow": "home" } ```
…8542) ## Short description Fix the `banner_id` analytics property for expiring and expired PID lifecycle banners while preserving the existing values for legacy eID banners. ## List of changes proposed in this pull request - Use `itwExpiringPidBanner` and `itwExpiredPidBanner` for PID lifecycle banners. - Preserve `itwExpiringIdBanner` and `itwExpiredIdBanner` for legacy eID banners. - Add parametrized tests covering visualization and tap events for all PID/eID lifecycle states. - Update the tracking hook documentation. ## How to test Manually verify the analytics events from both the wallet and ID detail: - Expiring PID sends `banner_id: itwExpiringPidBanner`. - Expired PID sends `banner_id: itwExpiredPidBanner`. - Expiring legacy eID still sends `banner_id: itwExpiringIdBanner`. - Expired legacy eID still sends `banner_id: itwExpiredIdBanner`.
…8346) Remove the `react-native-crypto` from dependencies. ## List of changes proposed in this pull request - Remove the package and all the relative references in the codebase ### Motivation The `crypto` module is already polyfilled by `react-native-quick-crypto`, redirected both by the Babel `module-resolver` alias and by Metro's `resolveRequest` hook in `metro.config.js` — either one shadows the `react-native`/`browser` fields in `package.json`. `react-native-crypto` was therefore never bundled: the app JS bundle is byte-identical before and after this change, on both Android and iOS. Removing it also drops its `react-native-randombytes` native pod. ### Related - #8342
) ## Short description This PR adds a new selector for retrieving the IDP friendly names URL. It also updates related tests to match the new structure and bumps the `IO_SERVICES_METADATA_VERSION` in the API generation script. ## List of changes proposed in this pull request - Refactored the fallback configuration from `FALLBACK_ONE_IDENTITY_IDPS_URLS` to `FALLBACK_ONE_IDENTITY_CONFIG`, which now includes both `idpsUrl` and `idpFriendlyNamesUrl` for each environment in `remoteConfig.ts`. - Updated the `oneIdentityIdpsUrlSelector` to use `FALLBACK_ONE_IDENTITY_CONFIG[env].idpsUrl` instead of the previous fallback. - Added a new selector, `oneIdentityIdpFriendlyNamesUrlSelector`, to retrieve the IDP friendly names URL for the current environment. - Updated tests in `remoteConfig.test.ts`. - Bumped `IO_SERVICES_METADATA_VERSION` from `1.1.3` to `1.1.4` in `generate-api-models.sh`. ## How to test All checks have to be green
## Short description This pull request focuses on simplifying the codebase by removing unnecessary functional programming dependencies (such as `fp-ts`'s `Option`, `Either`, and `pipe`) and replacing them with more idiomatic and straightforward TypeScript code. ## List of changes proposed in this pull request - Replaced uses of `fp-ts`'s `Option`, `Either`, and `pipe` with native TypeScript constructs and simplified conditional logic - Updated saga tests to remove `fp-ts` constructs, using plain objects for responses and errors, and adjusted assertions accordingly - Simplified and clarified error handling by throwing and catching native `Error` objects instead of wrapping them in `Either` or custom types, and using a consistent approach for network and generic errors. ## How to test Ensure CGN flow has no regression in all screens > [!IMPORTANT] > Must be refactored based on #8479
…let feature (#8504) ## Short description Removes `fp-ts` and `io-ts` from the `itwallet` feature, replacing them with native TypeScript, `zod` and `neverthrow`. This is the first step of the gradual migration away from `fp-ts`, now deprecated in our stack, and it is scoped to `itwallet` only: no other feature changes behaviour. ## List of changes proposed in this pull request - **`Option` → `T | undefined`** across selectors, machine seoks, components and screens. Store selectors were convertedfirst (`itwCredentialsEidSelector`, `itwCredentialSelector`), which removed `Option` from every consumer downstream. Machine selectors lost their `Option` suffix (`selectCredentialTypeOption` → `selectCredentialType`, and 12 others). - **`io-ts` → `zod`** for the credential claim schemas. `ItwCio-ts-types/JsonFromString`) is deleted, and`PatternString`/`NonEmptyString` from `@pagopa/ts-commons` are replaced by plain `zod` schemas. - **`Either` → `neverthrow` `Result`**. New `itwSchemaUtils.parseWithSchema` lifts a `zod` parse into a `Result`; `validateItwPresentationQrCodeParams` now returns `Result` via `Result.fromThrowable`. - **`ClaimValue` is now a tagged union.** `zod` cannot re-check a transformed value the way `io-ts`'s `.is()` did (`SimpleDateClaim` maps `string` → `SimpleDate`), so `parseClaimValue` returns `{ kind, value }` and consumers use an exhaustive `switch`. The order of the union members is unchanged, so claim resolution is identical. `CardClaimRenderer` takes `type guard. - **`integrityKeyTag` is no longer an `Option` in persisted state**, with a redux-persist migration (version `-1` → `0`) that unwraps the serialised `{_tag: "Some", value}` shape. The migration is idempotent: apasses through untouched. - **Regression tests** for `parseClaimValue` and `getClaimDisoverage. They pin down which `kind` each raw claim value resolves to, so reordering the union or inserting a new membeow a claim is rendered. - Two boundary adaptations outside `itwallet`: `features/barcode/types/decoders.ts` adapts the new `Result` back to an `Option`, and `ItwSpidIdpLoginScreen` unwraps `getIntentFallbackUrl` at the call site. ## How to test **A full Documenti su IO and IT-Wallet test should be done.** However, since this is a refactor with no intended behaviour change, the useful checks are on the rendering and persistence paths that were rewritten: **Claim rendering**; Open the detail screen of a PID, an mDL and a European Disability Card and confirm every claim renders as before: - dates in `DD/MM/YYYY` - the portrait as an image (it is a raw base64 payload with no data URL prefix, handled as a special case) - mDL driving privileges, in both the current nested format and the legacy JSON-string format - the EHIC PDF attachment, and the Disability Card QR code on the skeuomorphic card back - place of birth as `locality (country)`, boolean claims as localised labels, nested claims expanded - a fiscal code claim rendered without its `TINIT-` prefix **Persistence migration** 1. Install the current `master` build and activate the wallet. It's persisted in the old `Option` shape. 2. Install this branch over it, without clearing app data. 3. The wallet must still be active: no re-onboarding, no `wallanceInconsistencySaga` resets the wallet when a PID exists but the key tag is missing, so a failed migration would show up as the wallet being wiped on first launch. 4. Revoking the wallet and re-activating it must still work. **Remote presentation** - Scan a valid presentation QR code and a malformed one; the malformed one must reach the deep link failure screen rather than crashing, since that path moved from `E.tryCatch` to `Result.fromThrowable`. --------- Co-authored-by: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
gispada
marked this pull request as ready for review
September 7, 2026 13:29
gispada
requested review from
a team,
Leerti,
emilio-dimari and
soixdev91
as code owners
September 7, 2026 13:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
This PR adds the
suspendedstatus surfaced by the Token Status List (TSL) and updates the status override playground to support TSL.Note
Unlike with status assertions, in TSL the
suspendedstatus is not a subset of theinvalidstatus.List of changes proposed in this pull request
suspendedstatusHow to test
Override the status of a credential in the playground and ensure everything works as expected.