Skip to content

fix(davinci-client): event-name-and-formData #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ryanbas21
Copy link
Collaborator

JIRA Ticket

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

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

Description

defaults event name to continue when we don't have an event name (p1 forms) and ensures we don't add undefined to the formData keys

Copy link

changeset-bot bot commented Apr 23, 2025

🦋 Changeset detected

Latest commit: ba80bec

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

This PR includes changesets to release 6 packages
Name Type
@forgerock/davinci-client Patch
@forgerock/sdk-types Patch
@forgerock/sdk-utilities Patch
@forgerock/sdk-logger Patch
@forgerock/sdk-oidc Patch
@forgerock/sdk-request-middleware Patch

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

Copy link

nx-cloud bot commented Apr 23, 2025

View your CI Pipeline Execution ↗ for commit ba80bec.

Command Status Duration Result
nx affected -t build typecheck lint test e2e-ci ✅ Succeeded 1m 36s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-24 14:44:41 UTC

@ryanbas21 ryanbas21 force-pushed the default-event-name branch from ec4d5b7 to b21784c Compare April 23, 2025 22:04
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.29%. Comparing base (6cdc7b8) to head (ba80bec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   47.35%   56.29%   +8.94%     
==========================================
  Files          29       20       -9     
  Lines        1472     1295     -177     
  Branches      148      147       -1     
==========================================
+ Hits          697      729      +32     
+ Misses        775      566     -209     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/collector.utils.ts 93.14% <100.00%> (+9.12%) ⬆️
packages/davinci-client/src/lib/davinci.utils.ts 94.96% <100.00%> (+1.97%) ⬆️
packages/davinci-client/src/lib/node.slice.ts 82.98% <100.00%> (ø)

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Deployed 0b638d7 to https://ForgeRock.github.io/ping-javascript-sdk/pr-260/0b638d7fd2127c7351150c0714bce19dafadd6ae branch gh-pages in ForgeRock/ping-javascript-sdk

// No default or existing value is passed
},
output:
field.key !== undefined
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would the password field not have a key?

defaults event name to continue when we don't have an event name (p1
forms) and ensures we don't add undefined to the formData keys
@ryanbas21 ryanbas21 force-pushed the default-event-name branch from b21784c to ba80bec Compare April 24, 2025 14:41
@@ -41,7 +41,9 @@ export function transformSubmitRequest(node: ContinueNode): DaVinciRequest {
const formData = collectors?.reduce<{
[key: string]: string | number | boolean | (string | number | boolean)[];
}>((acc, collector) => {
acc[collector.input.key] = collector.input.value;
if (collector.input.key !== undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering why we need this. If we are filtering by category, and no collector within these categories should have an undefined, did we get something wrong?

options: options,
},
output:
field.key !== undefined
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't believe we should do this. If there's no key property, there's something fundamentally wrong with the data. If this is a SingleValueCollector, it requires a key in order to send the value back to the server. Without a key, we can't assign the collected value to something and the whole flow will break.

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.

3 participants