PollingCollector
A collector that handles asynchronous polling operations in DaVinci authentication flows.
The PollingCollector is used for authentication scenarios that require waiting for user actions on another device or channel, such as:
Push notification authentication
QR code scanning
Email verification
Out-of-band (OOB) authentication
Polling Modes
Simple Polling Mode
When pollChallengeStatus is false or challenge is empty, performs a simple delay-based polling without actively checking server status. After each delay:
Decrements retriesAllowed
Emits PollingStatus.Continue if retries remain
Emits PollingStatus.TimedOut when retries reach 0
This mode is useful for basic waiting periods where the client simply needs to wait before checking again.
Challenge Status Polling Mode
When pollChallengeStatus is true and challenge is not empty, actively polls a server endpoint to check the status of an authentication challenge. The polling continues until:
The challenge is completed successfully (PollingStatus.Complete)
Maximum retries are reached (PollingStatus.TimedOut)
The server returns a non-200 HTTP response (PollingStatus.Expired)
An error occurs (PollingStatus.Error)
Polling Endpoint: {baseUrl}/davinci/user/credentials/challenge/{challenge}/status
Flow-based API
The pollStatus method returns a Flow that emits PollingStatus updates throughout the polling lifecycle, providing real-time feedback to the application for UI updates.
Flow Interception: The flow automatically intercepts each emission using onEach to set the value property before the caller receives it. This ensures value is always synchronized with the emitted status.
## Value Assignment
The [value] property is automatically set via flow interception based on the polling outcome:
- [PollingStatus.Complete] → Server status value (e.g., "approved")
- [PollingStatus.TimedOut] → "timedOut"
- [PollingStatus.Expired] → "expired"
- [PollingStatus.Error] → "error"
- [PollingStatus.Continue] → "continue"
This value is submitted as part of the form data when continuing to the next node in the flow.
@see PollingStatus
@see pollProperties
The continue node for the DaVinci flow. Used to extract configuration and context for the polling operation.
Whether to actively poll for challenge status. When false, performs simple delay polling. When true, polls the server endpoint for challenge completion.
Polling interval in milliseconds between each polling attempt. Default value is "2000" (2 seconds).
Maximum number of polling attempts before timing out. Default value is "60".
The number of polling attempts remaining before timeout in simple polling mode.