Skip to content

chore: update poll naming#622

Merged
ancheetah merged 1 commit intomainfrom
update-poll-naming
May 4, 2026
Merged

chore: update poll naming#622
ancheetah merged 1 commit intomainfrom
update-poll-naming

Conversation

@ancheetah
Copy link
Copy Markdown
Collaborator

@ancheetah ancheetah commented May 1, 2026

JIRA Ticket

Description

Updates poll naming to pollStatus. Updates JSDocs and changeset description.

Summary by CodeRabbit

  • New Features

    • Added built-in polling support with two automatic modes (repeated status checks and retry-with-delay) and middleware interception for polling requests.
  • Tests

    • Updated end-to-end device registration test to reflect revised phone-number entry label text.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: e75ee94

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 12 packages
Name Type
@forgerock/sdk-request-middleware Minor
@forgerock/davinci-client Minor
@forgerock/journey-client Minor
@forgerock/oidc-client Minor
@forgerock/device-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/storage Minor

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

Renames the client polling helper from poll to pollStatus, updates JSDoc to describe automatic challenge vs continue polling modes, and adjusts e2e wiring and a test label and the changeset markdown to reflect the new API name and usage guidance.

Changes

Polling API Rename & Documentation

Layer / File(s) Summary
Public API / Docs
packages/davinci-client/src/lib/client.store.ts, .changeset/lucky-parts-own.md
Public helper renamed from pollpollStatus; JSDoc/changeset expanded to describe automatic detection of "challenge" (repeated /status) vs "continue" (delayed/remaining-retry) polling modes and middleware interception of polling requests.
Core Return Value / Wiring
packages/davinci-client/src/lib/client.store.ts
Return object updated to expose pollStatus(collector) (implementation unchanged beyond name and docs).
Consumption / Component API
e2e/davinci-app/components/polling.ts
pollingComponent parameter renamed from pollpollStatus; internal await call switched to await pollStatus().
Integration / Entrypoint
e2e/davinci-app/main.ts
Callsite changed to pass davinciClient.pollStatus(collector) into pollingComponent instead of davinciClient.poll(collector).
Tests
e2e/davinci-suites/src/phone-number-field.test.ts
Updated expected phone-number entry label text from SDK Automation - Enter Phone NumberSDK Automation [JS] - Enter Phone Number.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl
  • ryanbas21

Poem

🐰 I hopped through code with careful paws,

Renamed a helper without a pause.
poll became pollStatus, clear and bright,
Docs now tell of polling day and night.
🍃 A tiny change, but oh what cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: update poll naming' directly and specifically describes the main change across all files in this changeset—renaming the poll API from 'poll' to 'pollStatus'.
Description check ✅ Passed The description identifies the key changes (poll naming update, JSDoc updates, changeset updates) but provides minimal detail; however, it adequately conveys the scope and intent of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-poll-naming

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 1, 2026

View your CI Pipeline Execution ↗ for commit e75ee94

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 11s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-04 15:43:46 UTC

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/davinci-client/src/lib/client.store.ts (1)

425-446: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Preserve backward compatibility for renamed polling API.

Line 425 introduces pollStatus, but the prior public poll API is no longer present. That is a breaking runtime/API change for existing integrators. Please either keep a deprecated poll alias for one transition release, or explicitly treat this as a breaking migration.

Suggested compatibility patch
+  const buildPoller = (collector: PollingCollector): Poller => {
+    return async () => {
+      const result = await getPollingModeµ(collector).pipe(
+        Micro.flatMap((mode) => pollingµ({ mode, collector, store, log })),
+        Micro.tapError((err) => Micro.sync(() => log.error(err.error.message))),
+        Micro.runPromiseExit,
+      );
+
+      if (exitIsSuccess(result)) return result.value;
+      if (exitIsFail(result)) return result.cause.error;
+
+      return createInternalError(
+        'An unexpected error occurred during poll operation',
+        'unknown_error',
+      );
+    };
+  };
+
   return {
@@
-    pollStatus: (collector: PollingCollector): Poller => {
-      return async () => {
-        const result = await getPollingModeµ(collector).pipe(
-          Micro.flatMap((mode) => pollingµ({ mode, collector, store, log })),
-          Micro.tapError((err) => Micro.sync(() => log.error(err.error.message))),
-          Micro.runPromiseExit,
-        );
-
-        if (exitIsSuccess(result)) {
-          return result.value;
-        }
-
-        if (exitIsFail(result)) {
-          return result.cause.error;
-        }
-
-        return createInternalError(
-          'An unexpected error occurred during poll operation',
-          'unknown_error',
-        );
-      };
-    },
+    pollStatus: (collector: PollingCollector): Poller => buildPoller(collector),
+    /** `@deprecated` Use pollStatus(collector) */
+    poll: (collector: PollingCollector): Poller => buildPoller(collector),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/davinci-client/src/lib/client.store.ts` around lines 425 - 446, The
new pollStatus function replaces the old public poll API and breaks
compatibility; restore a deprecated alias by adding a poll export/function that
forwards to pollStatus (accepting the same PollingCollector and returning a
Poller) and mark it as deprecated in comments, or alternatively document this as
a breaking change; update references to PollingCollector and Poller so poll
simply calls and returns pollStatus(collector) to preserve runtime behavior for
existing integrators.
🧹 Nitpick comments (1)
.changeset/lucky-parts-own.md (1)

6-13: ⚡ Quick win

Make migration impact explicit in changeset text.

Lines 6-13 read as a feature add, but this PR renames the public API from poll() to pollStatus(). Please explicitly call out the rename/deprecation path so consumers know what to update.

Suggested wording
-Adds `pollStatus()` method and `PollingCollector` to `@forgerock/davinci-client` for polling support in DaVinci flows.
+Renames polling helper `poll()` to `pollStatus()` in `@forgerock/davinci-client`.
+Update integrations to call `davinciClient.pollStatus(collector)` instead of `davinciClient.poll(collector)`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/lucky-parts-own.md around lines 6 - 13, Update the changeset text
to explicitly call out that the public API was renamed from poll() to
pollStatus() in `@forgerock/davinci-client` and describe the migration/deprecation
path for consumers: mention that PollingCollector is unchanged, show that
callers should replace calls to poll(...) with pollStatus(collector) (or use the
returned poller function as before), note any backwards-compatibility or removal
timeline for poll(), and include a short example or migration hint referencing
poll() and pollStatus() so users know what to update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/davinci-client/src/lib/client.store.ts`:
- Around line 425-446: The new pollStatus function replaces the old public poll
API and breaks compatibility; restore a deprecated alias by adding a poll
export/function that forwards to pollStatus (accepting the same PollingCollector
and returning a Poller) and mark it as deprecated in comments, or alternatively
document this as a breaking change; update references to PollingCollector and
Poller so poll simply calls and returns pollStatus(collector) to preserve
runtime behavior for existing integrators.

---

Nitpick comments:
In @.changeset/lucky-parts-own.md:
- Around line 6-13: Update the changeset text to explicitly call out that the
public API was renamed from poll() to pollStatus() in `@forgerock/davinci-client`
and describe the migration/deprecation path for consumers: mention that
PollingCollector is unchanged, show that callers should replace calls to
poll(...) with pollStatus(collector) (or use the returned poller function as
before), note any backwards-compatibility or removal timeline for poll(), and
include a short example or migration hint referencing poll() and pollStatus() so
users know what to update.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: deff6212-bd5a-4c14-acc1-178db78abcac

📥 Commits

Reviewing files that changed from the base of the PR and between 07015a2 and e5e0fe0.

📒 Files selected for processing (4)
  • .changeset/lucky-parts-own.md
  • e2e/davinci-app/components/polling.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/src/lib/client.store.ts

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

A new CI pipeline execution was requested that may update the conclusion below...

Nx Cloud has identified a possible root cause for your failed CI:

We investigated the E2E failure in phone-number-field.test.ts and confirmed it is a pre-existing issue — the identical error reproduces on the main branch independent of this PR's changes. Our PR only updates poll naming to pollStatus across @forgerock/davinci-client and @forgerock/davinci-app, with no changes to the phone number field flow or the @forgerock/davinci-suites project. This failure is caused by an external backend service dependency and is unrelated to our changes.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


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

Copy link
Copy Markdown
Contributor

@SteinGabriel SteinGabriel left a comment

Choose a reason for hiding this comment

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

Other than outdated date in copyright headers of a few files and the CI error, changes look good to go!
Files:

  • packages/davinci-client/src/lib/client.store.ts
  • e2e/davinci-app/components/polling.ts
  • e2e/davinci-app/main.ts

Btw, I'm adding the copyright header automation to this repo next, as soon as I have a spare time.

@ancheetah ancheetah force-pushed the update-poll-naming branch from e5e0fe0 to e75ee94 Compare May 4, 2026 15:40
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

@forgerock/davinci-client

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

@forgerock/device-client

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

@forgerock/journey-client

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

@forgerock/oidc-client

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

@forgerock/protect

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

@forgerock/sdk-types

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

@forgerock/sdk-utilities

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

@forgerock/iframe-manager

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

@forgerock/sdk-logger

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

@forgerock/sdk-oidc

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

@forgerock/sdk-request-middleware

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

@forgerock/storage

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

commit: e75ee94

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.48%. Comparing base (5d6747a) to head (e75ee94).
⚠️ Report is 88 commits behind head on main.

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/client.store.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (17.48%) 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             @@
##             main     #622       +/-   ##
===========================================
- Coverage   70.90%   17.48%   -53.42%     
===========================================
  Files          53      154      +101     
  Lines        2021    24195    +22174     
  Branches      377     1146      +769     
===========================================
+ Hits         1433     4231     +2798     
- Misses        588    19964    +19376     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/client.store.ts 0.29% <0.00%> (ø)

... and 100 files with indirect coverage changes

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Deployed 1a87b14 to https://ForgeRock.github.io/ping-javascript-sdk/pr-622/1a87b1433485066e547ed171baca6a8f1bdf2670 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-90.3 KB, -100.0%)
🔺 @forgerock/journey-client - 91.9 KB (+1.6 KB, +1.8%)

📊 Minor Changes

📈 @forgerock/davinci-client - 48.6 KB (+0.2 KB)

➖ No Changes

@forgerock/device-client - 10.0 KB
@forgerock/oidc-client - 25.2 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/protect - 144.6 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/davinci-client/src/lib/client.store.ts (1)

418-446: ⚠️ Potential issue | 🔴 Critical

Mark the changeset as a major bump — renaming a public API method is a breaking change.

The commit message "chore: update poll naming" confirms this is a rename of the public poll() method to pollStatus(). While the changeset description says "Adds," this is actually a breaking API change that requires a major version bump, not minor. No stale references remain in the codebase, so update .changeset/lucky-parts-own.md to change '@forgerock/davinci-client': minor to '@forgerock/davinci-client': major.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/davinci-client/src/lib/client.store.ts` around lines 418 - 446, The
public API method was renamed from poll() to pollStatus() which is a breaking
change; update the changeset file .changeset/lucky-parts-own.md to mark the
package '@forgerock/davinci-client' as a major bump instead of minor so the
release reflects this breaking rename (search for pollStatus or poll in the diff
to confirm the rename and update the changeset entry accordingly).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/davinci-client/src/lib/client.store.ts`:
- Around line 418-446: The public API method was renamed from poll() to
pollStatus() which is a breaking change; update the changeset file
.changeset/lucky-parts-own.md to mark the package '@forgerock/davinci-client' as
a major bump instead of minor so the release reflects this breaking rename
(search for pollStatus or poll in the diff to confirm the rename and update the
changeset entry accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0c1bff97-910d-4454-b1c3-bcae18fff29e

📥 Commits

Reviewing files that changed from the base of the PR and between e5e0fe0 and e75ee94.

📒 Files selected for processing (5)
  • .changeset/lucky-parts-own.md
  • e2e/davinci-app/components/polling.ts
  • e2e/davinci-app/main.ts
  • e2e/davinci-suites/src/phone-number-field.test.ts
  • packages/davinci-client/src/lib/client.store.ts
✅ Files skipped from review due to trivial changes (2)
  • e2e/davinci-app/main.ts
  • .changeset/lucky-parts-own.md

@ancheetah
Copy link
Copy Markdown
Collaborator Author

Other than outdated date in copyright headers of a few files and the CI error, changes look good to go! Files:

  • packages/davinci-client/src/lib/client.store.ts
  • e2e/davinci-app/components/polling.ts
  • e2e/davinci-app/main.ts

Btw, I'm adding the copyright header automation to this repo next, as soon as I have a spare time.

Thanks, I've fixed the failing test which should unblock anyone who has issues with that test. I only changed copyright in the polling component. We can just batch update the rest of the copyrights later.

@ancheetah ancheetah merged commit eedcca7 into main May 4, 2026
9 checks passed
@ancheetah ancheetah deleted the update-poll-naming branch May 4, 2026 15:49
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