Skip to content

chore(IT-Wallet): [SIW-4952] Handle suspended status from TSL, update status playground to support TSL - #8550

Merged
gispada merged 19 commits into
masterfrom
SIW-4952-suspended
Sep 9, 2026
Merged

chore(IT-Wallet): [SIW-4952] Handle suspended status from TSL, update status playground to support TSL#8550
gispada merged 19 commits into
masterfrom
SIW-4952-suspended

Conversation

@gispada

@gispada gispada commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Short description

This PR adds the suspended status surfaced by the Token Status List (TSL) and updates the status override playground to support TSL.

Note

Unlike with status assertions, in TSL the suspended status is not a subset of the invalid status.

List of changes proposed in this pull request

  • Added the suspended status
  • Updated the status override playground to work with status list-based credentials

How to test

Override the status of a credential in the playground and ensure everything works as expected.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Jira Pull Request Link

This Pull Request refers to Jira issues:

@gispada gispada changed the title chore(IT-Wallet) [SIW-4952] Handle suspended status from TSL, update status playground to support TSL chore(IT-Wallet): [SIW-4952] Handle suspended status from TSL, update status playground to support TSL Sep 4, 2026
@gispada gispada self-assigned this Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.25%. Comparing base (7b499b6) to head (d0300a3).

Additional details and impacted files

Impacted file tree graph

@@           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           
Files with missing lines Coverage Δ
...-app/ts/features/itwallet/analytics/utils/types.ts 57.14% <ø> (ø)
.../itwallet/common/components/ItwCredentialClaim.tsx 57.64% <ø> (ø)
...let/common/components/ItwSkeumorphicCard/index.tsx 15.62% <ø> (ø)
.../itwallet/common/utils/itwCredentialStatusUtils.ts 100.00% <100.00%> (ø)
...atures/itwallet/common/utils/itwCredentialUtils.ts 89.28% <ø> (ø)
...ts/features/itwallet/common/utils/itwTypesUtils.ts 62.50% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b499b6...d0300a3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

adelloste and others added 10 commits September 7, 2026 14:27
…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
gispada marked this pull request as ready for review September 7, 2026 13:29

@mastro993 mastro993 left a comment

Copy link
Copy Markdown
Contributor

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 Sep 9, 2026
Merged via the queue into master with commit 471943e Sep 9, 2026
13 checks passed
@gispada
gispada deleted the SIW-4952-suspended branch September 9, 2026 14:27
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.

7 participants