# p-retry changelog > Retries a promise-returning function with exponential backoff. - Vendor: Sindre Sorhus - Category: Frameworks & Libraries - Official site: https://github.com/sindresorhus/p-retry - Tracked by: What's New (https://whatsnew.fyi/product/p-retry) - Harvested from: GitHub (sindresorhus/p-retry) - Entries below: 10 (newest first) What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. ## Releases ### v8.0.0 - Date: 2026-03-26 - Version: v8.0.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v8.0.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v8.0.0 - **removed** — Drop support for Node.js versions below 22 - **changed** — Change retry callback order from onFailedAttempt → shouldConsumeRetry → shouldRetry to shouldConsumeRetry → onFailedAttempt → shouldRetry - **added** — Add retryDelay to onFailedAttempt context - **fixed** — Fix TypeError retry handling - **changed** — Harden retry timing and callback validation ###### Breaking - Require Node.js 22 85cdece - Change retry callback order 616306e - Callback order changed from `onFailedAttempt` → `shouldConsumeRetry` → `shouldRetry` to `shouldConsumeRetry` → `onFailedAttempt` → `shouldRetry`. - Consumption decisions are now made before failure notifications and retry decisions. ###### Improvements - Add [`retryDelay`](https://github.com/sindresorhus/p-retry#retrydelay) to `onFailedAttempt` context (#66) 96cce98 - Fix `TypeError` retry handling f011d2e - Harden retry timing and callback validation 9d47b60 --- https://github.com/sindresorhus/p-retry/compare/v7.1.1...v8.0.0 ### v7.1.1 - Date: 2025-12-09 - Version: v7.1.1 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v7.1.1 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v7.1.1 - **fixed** — Fix delayed abort when signal is already aborted before delay phase - Fix delayed abort when signal is already aborted before delay phase 2aba573 --- https://github.com/sindresorhus/p-retry/compare/v7.1.0...v7.1.1 ### v7.1.0 - Date: 2025-10-09 - Version: v7.1.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v7.1.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v7.1.0 - **added** — Add shouldConsumeRetry option to control whether a retry should be consumed - Add [`shouldConsumeRetry`](https://github.com/sindresorhus/p-retry?tab=readme-ov-file#shouldconsumeretrycontext) option (#96) 26d6e05 --- https://github.com/sindresorhus/p-retry/compare/v7.0.0...v7.1.0 ### v7.0.0 - Date: 2025-08-21 - Version: v7.0.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v7.0.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v7.0.0 - **removed** — Require Node.js 20 or later - **changed** — onFailedAttempt and shouldRetry now receive a context object instead of a decorated error, with the error accessible as context.error - **removed** — Remove the forever option, use {retries: Infinity} instead for infinite retries - **changed** — Rewrite the package to not depend on the retry package - **added** — Add makeRetriable method ###### Breaking - Require Node.js 20 3bdb53a - `onFailedAttempt` and `shouldRetry` now receive a `context` object instead of a decorated `error` bff36bb - You must now must access the error as `object.error` instead of `object`. - The use of `.attemptNumber` and `.retriesLeft` did not change. - Remove the `forever` option (#79) 6a89827 - Many use-cases can use `{retries: Infinity}` instead for infinite retries. ###### Improvements - Rewrite the package to not depend on the `retry` package (#79) 6a89827 - This is a full rewrite, so test carefully. - Add [`makeRetriable`](https://github.com/sindresorhus/p-retry#makeretriablefunction-options) method 1a81c1e --- https://github.com/sindresorhus/p-retry/compare/v6.2.1...v7.0.0 ### v7.0.0-0 - Date: 2025-05-06 - Version: v7.0.0-0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v7.0.0-0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v7.0.0-0 - Labels: Pre-release - **removed** — Require Node.js 20 - **changed** — onFailedAttempt and shouldRetry now receive a context object instead of a decorated error, with error accessible as object.error - **removed** — Remove the forever option - **changed** — Rewrite the package to not depend on the retry package - **added** — Add makeRetriable method ###### Breaking - Require Node.js 20 3bdb53a - `onFailedAttempt` and `shouldRetry` now receive a `context` object instead of a decorated `error` bff36bb - You must now must access the error as `object.error` instead of `object`. - The use of `.attemptNumber` and `.retriesLeft` did not change. - Remove the `forever` option (#79) 6a89827 - Many use-cases can use `{retries: Infinity}` instead for infinite retries. ###### Improvements - Rewrite the package to not depend on the `retry` package (#79) 6a89827 - This is a full rewrite, so test carefully. - Add [`makeRetriable`](https://github.com/sindresorhus/p-retry?tab=readme-ov-file#makeretriablefunction-options) method 1a81c1e --- https://github.com/sindresorhus/p-retry/compare/v6.2.1...v7.0.0-0 ### v6.2.1 - Date: 2024-11-15 - Version: v6.2.1 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v6.2.1 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v6.2.1 - **fixed** — Fix `onFailedAttempt` and `shouldRetry` options being `undefined` - Fix `onFailedAttempt` and `shouldRetry` options being `undefined` (#82) b400af6 https://github.com/sindresorhus/p-retry/compare/v6.2.0...v6.2.1 ### v6.2.0 - Date: 2023-12-20 - Version: v6.2.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v6.2.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v6.2.0 - **added** — Add shouldRetry option to control whether to retry on specific errors - Add [`shouldRetry`](https://github.com/sindresorhus/p-retry#shouldretryerror) option (#75) b993a96 https://github.com/sindresorhus/p-retry/compare/v6.1.0...v6.2.0 ### v6.1.0 - Date: 2023-09-26 - Version: v6.1.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v6.1.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v6.1.0 - **changed** — Move network error detection into a separate package - Move network error detection into a [separate package](https://github.com/sindresorhus/is-network-error) ba073f3 https://github.com/sindresorhus/p-retry/compare/v6.0.0...v6.1.0 ### v6.0.0 - Date: 2023-08-24 - Version: v6.0.0 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v6.0.0 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v6.0.0 - **removed** — Drop support for Node.js versions below 16 - **fixed** — Correctly remove abort handler when done ###### Breaking - Require Node.js 16 b38fd69 ###### Fixes - Correctly remove abort handler when done 95a3a4a https://github.com/sindresorhus/p-retry/compare/v5.1.2...v6.0.0 ### v5.1.2 - Date: 2022-11-23 - Version: v5.1.2 - Original notes: https://github.com/sindresorhus/p-retry/releases/tag/v5.1.2 - Permalink: https://whatsnew.fyi/product/p-retry/releases/v5.1.2 - **added** — Add Undici network error handling - Add Undici network error handling (#68) fb5f6f8 https://github.com/sindresorhus/p-retry/compare/v5.1.1...v5.1.2