Skip to content

IS-11797 Rename pollingInterval config to defaultPollingInterval - #326

Merged
aleixsuau merged 3 commits into
devfrom
feature/dev/IS-11797-default-polling-interval
Sep 30, 2026
Merged

aleixsuau merged 3 commits into
devfrom
feature/dev/IS-11797-default-polling-interval

Conversation

@aleixsuau

@aleixsuau aleixsuau commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Jira: https://curity.atlassian.net/browse/IS-11797

Purpose & Context

pollingInterval read like the value the app controls. It is not. A polling step's properties.interval from the server always wins, and the app value is only the fallback. The logic is the more specific rule wins (step config > app config > default config). The rename to defaultPollingInterval makes that explicit.

Today only BankID sends an interval (1000 ms). SMS, email and Duo polling steps do not, so they use this default.

Backend: no backend change. Works against dev.

How to Test & Review

Setup: a local identity server configured with IDSVR_HOME=<dist> ./configure-idsvr-dev.sh from src/haapi-react-app/, and npm run dev running in that folder. The app is then served on https://localhost:8443.

  1. Open the network tab filtered on poll, then visit https://localhost:8443/dev/oauth/authorize?client_id=client-one&redirect_uri=https://localhost:7777/client-callback&response_type=code&state=random.
    1. Verify the authenticator selector shows bankid1, sms1 and email1.
  2. Select bankid1.
    1. Verify the poll requests go every 1 s. That is the server value.
  3. Visit https://localhost:8443/dev/oauth/authorize?client_id=client-one&redirect_uri=https://localhost:7777/client-callback&response_type=code&state=random again and select sms1.
    1. Verify the poll requests go every 3 s. That is the SDK default.

Non-Functional Impact

Release note: HAAPI React SDK config pollingInterval renamed to defaultPollingInterval.

@aleixsuau
aleixsuau force-pushed the feature/dev/IS-11797-default-polling-interval branch from 355c59b to 2e56a88 Compare September 11, 2026 07:58
@aleixsuau
aleixsuau marked this pull request as ready for review September 11, 2026 09:39
Copilot AI lite review requested due to automatic review settings September 11, 2026 09:39
@aleixsuau
aleixsuau force-pushed the feature/dev/IS-11797-default-polling-interval branch from 4af9982 to fb90033 Compare September 11, 2026 09:41

Copilot AI 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.

🟡 Changes recommended

Server interval validation accepts Infinity, which can cause immediate repeated polling.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Renames the HAAPI React SDK polling fallback configuration from pollingInterval to defaultPollingInterval, while prioritizing valid server-provided intervals.

Changes:

  • Updates configuration types, defaults, mocks, and previewer usage.
  • Adds interval precedence and validation tests.
  • Updates polling integration tests and documentation.
File summaries
File Description
src/haapi-react-sdk/haapi-stepper/util/tests/mocks.ts Updates test configuration and polling-step fixtures.
src/haapi-react-sdk/haapi-stepper/feature/stepper/step-handlers/polling-step.ts Resolves server and default polling intervals.
src/haapi-react-sdk/haapi-stepper/feature/stepper/step-handlers/polling-step.spec.ts Tests polling interval behavior and precedence.
src/haapi-react-sdk/haapi-stepper/feature/stepper/HaapiStepper.tsx Applies the renamed default configuration.
src/haapi-react-sdk/haapi-stepper/feature/stepper/HaapiStepper.spec.tsx Updates integration tests.
src/haapi-react-sdk/haapi-stepper/feature/stepper/haapi-stepper.types.ts Renames and documents the configuration property.
src/haapi-react-app/previewer/Previewer.tsx Updates preview configuration.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/haapi-react-sdk/haapi-stepper/feature/stepper/step-handlers/polling-step.ts Outdated
Comment thread src/haapi-react-sdk/haapi-stepper/feature/stepper/step-handlers/polling-step.ts Outdated
*
* Defaults to 3000.
*/
defaultPollingInterval: number;

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.

Nice to keep it simple.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@aleixsuau
aleixsuau merged commit 77ff182 into dev Sep 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants