Skip to content

feat(davinci-client): send FIDO errors to DaVinci#728

Open
ancheetah wants to merge 1 commit into
SDKS-5100-metadata-collectorfrom
SDKS-4480-fido-errors
Open

feat(davinci-client): send FIDO errors to DaVinci#728
ancheetah wants to merge 1 commit into
SDKS-5100-metadata-collectorfrom
SDKS-4480-fido-errors

Conversation

@ancheetah

@ancheetah ancheetah commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4480

Description

Most of this was taken from #503.
TODO: wire up flow for FIDO errors and write e2e tests

Note: This also fixes a false positive from password validation test and corrects some wiring in the registration node in the flow.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5165254

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/davinci-client Minor
@forgerock/device-client Minor
@forgerock/journey-client Minor
@forgerock/oidc-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 06d0856f-1793-4967-a1a0-b8b4b8c50b19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4480-fido-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 5165254

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 2m 54s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-24 23:53:14 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@728

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@728

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@728

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@728

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@728

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@728

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@728

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@728

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@728

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@728

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@728

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@728

commit: 5165254

@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.17117% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.73%. Comparing base (a2cae19) to head (5165254).

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/davinci.api.ts 0.00% 19 Missing ⚠️
packages/davinci-client/src/lib/fido/fido.ts 72.72% 12 Missing ⚠️
packages/davinci-client/src/types.ts 50.00% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (23.73%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           SDKS-5100-metadata-collector     #728      +/-   ##
================================================================
+ Coverage                         23.26%   23.73%   +0.47%     
================================================================
  Files                               161      162       +1     
  Lines                             25667    25718      +51     
  Branches                           1626     1661      +35     
================================================================
+ Hits                               5971     6104     +133     
+ Misses                            19696    19614      -82     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/client.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/davinci.utils.ts 86.41% <100.00%> (ø)
packages/davinci-client/src/lib/fido/fido.types.ts 100.00% <100.00%> (ø)
packages/davinci-client/src/lib/fido/fido.utils.ts 99.24% <100.00%> (+0.28%) ⬆️
packages/davinci-client/src/lib/node.reducer.ts 74.60% <100.00%> (+0.40%) ⬆️
packages/davinci-client/src/types.ts 11.11% <50.00%> (-1.39%) ⬇️
packages/davinci-client/src/lib/fido/fido.ts 85.32% <72.72%> (+84.45%) ⬆️
packages/davinci-client/src/lib/davinci.api.ts 27.85% <0.00%> (-1.69%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Deployed cbc6c62 to https://ForgeRock.github.io/ping-javascript-sdk/pr-728/cbc6c624f4639f45580dbe657cceeec5aac73016 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔺 @forgerock/davinci-client - 56.9 KB (+2.5 KB, +4.5%)

🆕 New Packages

🆕 @forgerock/journey-client - 92.6 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)
🆕 @forgerock/device-client - 10.0 KB (new)
🆕 @forgerock/device-client - 0.0 KB (new)

➖ No Changes

@forgerock/sdk-types - 9.1 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/sdk-utilities - 18.6 KB
@forgerock/oidc-client - 35.3 KB
@forgerock/protect - 144.6 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch from 8693a1d to a2cae19 Compare July 23, 2026 21:05

@cerebrl cerebrl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this PR is based on the Metadata PR. If I look at just the FIDO related commit, it looks good. But, this also contains the other unrelated changes for Metadata, so I'm hesitate to approve as this may be a mistake.

@SteinGabriel

SteinGabriel commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

I can see that the FIDO GenericError is being created and returned, but I don't see it being propagated back to the DaVinci flow in davinci.api.ts, as the ticket seems to imply.
I'd like to confirm whether sending the FIDO error code back in a request to DaVinci is consumer-owned rather than SDK-owned, or if I'm missing something in the implementation.
Everything else related to the FIDO changes looks good!

Edit: I just saw in the description that wiring up the flow is in TODO. I'll do another review when that's done.

@ancheetah

Copy link
Copy Markdown
Collaborator Author

Sorry about that everyone, I am about to push up the part where we send the payload to DaVinci. Looks like my rebase got messed up because metadata shouldn't be in here. Let me fix and let you know when it's ready again.

@ancheetah
ancheetah force-pushed the SDKS-4480-fido-errors branch from 79ba07f to acd6de3 Compare July 24, 2026 16:59

@nx-cloud nx-cloud Bot 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.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We restored the collector-based formData building in transformActionRequest that was inadvertently removed by the FIDO error PR. Without it, the MetadataCollector's value was never sent to the server, so DaVinci had no payload to echo back — causing both metadata e2e assertions ("status":"succeeded" and "code":"ERROR_CODE") to fail. This fix re-aligns transformActionRequest with transformSubmitRequest's collector filtering, ensuring metadata values are included in action submissions while leaving the new FIDO error actionKey routing intact.

Tip

We verified this fix by re-running @forgerock/davinci-suites:e2e-ci--src/metadata.test.ts.

Suggested Fix changes
diff --git a/packages/davinci-client/src/lib/davinci.utils.ts b/packages/davinci-client/src/lib/davinci.utils.ts
index b637234..db14770 100644
--- a/packages/davinci-client/src/lib/davinci.utils.ts
+++ b/packages/davinci-client/src/lib/davinci.utils.ts
@@ -88,7 +88,26 @@ export function transformActionRequest(
   action: string,
   logger: ReturnType<typeof loggerFn>,
 ): DaVinciRequest {
+  // Filter out ActionCollectors as they do not collect values
+  const collectors = node.client?.collectors?.filter(
+    (collector) =>
+      collector.category === 'MultiValueCollector' ||
+      collector.category === 'SingleValueCollector' ||
+      collector.category === 'ValidatedSingleValueCollector' ||
+      collector.category === 'ObjectValueCollector' ||
+      collector.category === 'SingleValueAutoCollector' ||
+      collector.category === 'ObjectValueAutoCollector',
+  );
+
+  const formData = collectors?.reduce<{
+    [key: string]: DaVinciRequestValueTypes | Record<string, unknown>;
+  }>((acc, collector) => {
+    acc[collector.input.key] = collector.input.value;
+    return acc;
+  }, {});
+
   logger.debug('Transforming action request', { node, action });
+
   return {
     id: node.server.id || '',
     eventName: node.server.eventName || '',
@@ -97,7 +116,7 @@ export function transformActionRequest(
       eventType: 'action',
       data: {
         actionKey: action || node.client?.action || '',
-        formData: {},
+        ...(Object.keys(formData ?? {}).length && { formData: formData }),
       },
     },
   };

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally Q90f-8hXj

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@ancheetah
ancheetah force-pushed the SDKS-4480-fido-errors branch from acd6de3 to 5165254 Compare July 24, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants