unstale

npm / p-retry

p-retry

What changed in p-retry 4 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

15 breaking1 security2 new APIs and options1 behavior and defaults1 tooling12 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

p-retry 915 changes

Breaking changes 6

  • The randomize option must be a boolean; other values throw a TypeError.

    9.0.0release notes

  • The signal option must be an AbortSignal; other values throw a TypeError.

    9.0.0release notes

  • The unref option must be a boolean; other values throw a TypeError.

    9.0.0release notes

  • Delays above 2147483647ms are capped at that value instead of firing immediately.

    9.0.0release notes

  • Returning nothing now counts as true, so a callback that omits a return no longer bypasses the retries budget.

    9.0.0release notes

  • Once aborted, the signal's reason always rejects the promise, and no more callbacks are called.

    9.0.0release notes

Behavior and default changes 1

Fixes and other changes 8

  • A nested AbortError no longer escapes instead of its cause.

    9.0.0release notes

  • The wrapped error now has the correct message and its stack starts at the caller instead of inside p-retry.

    9.0.0release notes

  • A thrown value that cannot be stringified no longer replaces the real failure.

    9.0.0release notes

  • The function passed to makeRetriable now retains its this type.

    9.0.0release notes

  • Options can now be explicitly passed as undefined when using exactOptionalPropertyTypes.

    9.0.0release notes

  • Fixes a NaN retry delay when minTimeout is 0 and factor grows to Infinity.

    9.0.0release notes

  • Reports retryDelay: 0 for a TypeError that is never retried.

    9.0.0release notes

  • The callback is also called when maxRetryTime has run out, preserving the documented callback order.

    9.0.0release notes

p-retry 86 changes

Breaking changes 2

  • Node.js 22 is now required to use p-retry.

    4.0.0, 8.0.0release notesrelease notes

  • Callbacks now run in the order shouldConsumeRetry, onFailedAttempt, then shouldRetry; consumption decisions precede failure notifications and retry decisions.

    8.0.0release notes

Security 1

  • Retry timing and callback validation were hardened.

    8.0.0release notes

New APIs and options 1

  • The onFailedAttempt context now includes retryDelay, making the retry delay available to the callback.

    8.0.0release notes

Fixes and other changes 2

p-retry 75 changes

Breaking changes 3

  • The forever option was removed; use {retries: Infinity} for infinite retries.

    7.0.0release notes

  • Node.js 20 is now required to run p-retry.

    7.0.0release notes

  • The callback now receives a context object instead of a decorated error; access the error as object.error. attemptNumber and retriesLeft are unchanged.

    7.0.0release notes

New APIs and options 1

Fixes and other changes 1

  • Fixes delayed abort when the signal is already aborted before the delay phase.

    7.1.1release notes

p-retry 62 changes

Breaking changes 1

Fixes and other changes 1

  • The abort handler is correctly removed when done.

    6.0.0release notes

p-retry 52 changes

Breaking changes 2

  • The minimum required Node.js version is now 12.20.

    5.0.0release notes

  • The package is now pure ESM, which changes how developers import and use it.

    5.0.0release notes

p-retry 42 changes

Breaking changes 1

  • Throwing a non-error now produces a useful error.

    4.0.0release notes

Tooling 1

  • A TypeScript definition is now included for developers using p-retry with TypeScript.

    4.0.0release notes