Runs one try; receives the 1-based attempt number and resolves to a result.
Returns true when attempt's result is acceptable and retrying should stop.
Optionaloptions: { delayMs?: number; maxAttempts?: number }OptionaldelayMs?: numberDelay between tries. Defaults to 0.
OptionalmaxAttempts?: numberTotal tries; clamped to at least 1. Defaults to 3.
The first accepted result, or the last attempt's result if none qualified.
Repeatedly runs an async attempt until its result is accepted or the attempt budget is exhausted, waiting a fixed delay between tries (never after the last). Always resolves to the last result — it never throws on exhaustion, so the caller decides what a give-up result means.
This is the fixed-attempts + fixed-delay retry shape shared by flaky-startup probes (e.g.
resolveRegistrationValidity, and the missing-handler retry inrequestWithRetry). For deadline- or abort-driven retries with variable backoff (e.g.requestSessionSyncWithBootRetryin startup-tasks), use a bespoke loop instead — this helper deliberately does not cover those.