Skip to content

chore: update poll naming#622

Open
ancheetah wants to merge 1 commit intomainfrom
update-poll-naming
Open

chore: update poll naming#622
ancheetah wants to merge 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

Release Notes

  • New Features
    • Introduced pollStatus() API supporting two polling modes: challenge polling via repeated status calls and continue polling with retry-based delays. Polling requests are now interceptible via middleware.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: e5e0fe0

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

The pull request renames the polling API method from poll to pollStatus across the davinci-client package, its e2e tests, and associated documentation. This change updates the public API signature, parameter names in test components, and callsites to reflect the new method name while preserving underlying functionality and behavior.

Changes

Cohort / File(s) Summary
Polling API Method Rename
packages/davinci-client/src/lib/client.store.ts
Client API method renamed from poll(collector) to pollStatus(collector). Documentation expanded to clarify challenge polling and continue polling modes. Implementation logic remains unchanged.
E2E Test Integration
e2e/davinci-app/components/polling.ts, e2e/davinci-app/main.ts
Test component parameter updated from poll to pollStatus and corresponding callsite updated to use davinciClient.pollStatus(collector). Error handling and result logic unchanged.
Documentation Update
.changeset/lucky-parts-own.md
Changeset description updated to document the new pollStatus(collector) API, its two operational modes, and usage patterns with middleware interception support.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • cerebrl
  • ryanbas21

Poem

🐰 A method renamed, from poll to pollStatus it goes,
No logic shifts, just clarity that flows,
In clients and tests, the change takes its place,
The API evolves with a new, clearer face!

🚥 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 summarizes the main change—renaming the poll API to pollStatus across the codebase.
Description check ✅ Passed The description mentions updating poll naming to pollStatus and JSDoc/changeset updates, but lacks detail on what changed and why; however it covers the core changes adequately.
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

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 e5e0fe0

Command Status Duration Result
nx affected -t build lint test typecheck e2e-ci ❌ Failed 7m 16s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-01 17:05:44 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.

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.

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