Skip to content

refactor: [IOPID-4168] remove fp-ts from lollipop index and fetch utils - #8466

Open
Leerti wants to merge 4 commits into
masterfrom
IOPID-4168-remove-fp-ts-from-lollipop-utils
Open

refactor: [IOPID-4168] remove fp-ts from lollipop index and fetch utils#8466
Leerti wants to merge 4 commits into
masterfrom
IOPID-4168-remove-fp-ts-from-lollipop-utils

Conversation

@Leerti

@Leerti Leerti commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Short description

Removes fp-ts from lollipop/index.ts and lollipop/utils/fetch.ts, replacing pipe/Task/TaskEither/Array combinators with native async/await and plain array methods.

List of changes proposed in this pull request

  • chainSignPromises: now takes a single Promise<Array<SignPromiseResult>> and returns [] on rejection via try/catch, instead of A.sequence(TE.ApplicativePar) + TE.getOrElse
  • handleRegenerateEphemeralKey: rewritten with async/await and try/catch, returns PublicKey | undefined directly (previously wrapped incorrectly in T.of(...), which returned an unresolved Task instead of the value)
  • taskRegenerateKey renamed to regenerateKey and rewritten as a plain async function (no longer a TaskEither)
  • customContentSignatureBases (fetch.ts): rewritten with a plain if/.map instead of pipe/O.fromNullable/O.fold/A.mapWithIndex
  • customContentToSignPromises (fetch.ts): rewritten with Promise.all/async-await instead of pipe/A.map/TE.tryCatch/TE.map
  • Updated index.test.ts to match the new chainSignPromises signature (plain promises instead of TE.right/TE.left)

How to test

  1. Run pnpm nx run main-app:test-dev --testPathPattern=lollipop — all 168 tests should pass
  2. Run pnpm nx run main-app:tsc-noemit and pnpm nx lint main-app — no errors
  3. Manually: perform a SPID/CIE login and verify the lollipop signature headers are generated correctly, including any custom content signatures (e.g. in a flow that uses customContentToSign)
  4. Manually: simulate a key regeneration failure (e.g. by forcing deleteKey/generate to reject) and confirm the app falls back gracefully (ephemeral key removed from store, login still proceeds without lollipop headers)

@Leerti
Leerti requested review from a team, emilio-dimari, gispada and soixdev91 as code owners August 18, 2026 10:44
@Leerti Leerti added the IO-FIA IO Foundation - Identità & Accessi label Aug 18, 2026
@github-actions

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 Aug 18, 2026

Copy link
Copy Markdown
Contributor

Jira Pull Request Link

This Pull Request refers to Jira issues:

@github-actions

Copy link
Copy Markdown
Contributor

Unused code check

Knip compared this branch against master and found 1 item that nothing references any more:

↗️ Unused exports

  • regenerateKey in apps/main-app/ts/features/lollipop/index.ts

Some of these may sit in files you never opened. Removing an import is all it takes to orphan whatever was on the other end of it.

If it is intentional (upcoming work, dynamic imports, codegen templates), ignore this comment.

Also, 1 previously reported item is no longer flagged as unused, having been either referenced or removed:

  • taskRegenerateKey in apps/main-app/ts/features/lollipop/index.ts

Advisory only. This check never blocks a merge. A renamed or moved item counts on both sides.

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.79%. Comparing base (9e83e7a) to head (40916ad).

Files with missing lines Patch % Lines
apps/main-app/ts/features/lollipop/index.ts 95.45% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8466   +/-   ##
=======================================
  Coverage   63.79%   63.79%           
=======================================
  Files        1978     1978           
  Lines       37598    37603    +5     
  Branches     6360     6361    +1     
=======================================
+ Hits        23985    23990    +5     
  Misses      12235    12235           
  Partials     1378     1378           
Files with missing lines Coverage Δ
apps/main-app/ts/features/lollipop/utils/fetch.ts 91.93% <100.00%> (+1.77%) ⬆️
apps/main-app/ts/features/lollipop/index.ts 95.83% <95.45%> (+0.83%) ⬆️

... and 2 files with indirect coverage changes


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 9e83e7a...40916ad. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IO-FIA IO Foundation - Identità & Accessi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant