Skip to content

util: revoke DEP0174 and forward promisify rejections - #67489

Open
jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:util-promisify-dep0174
Open

jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:util-promisify-dep0174

Conversation

@jasnell

@jasnell jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member

Calling a promisified function whose original returns a Promise is a likely mistake rather than use of a deprecated API, so DEP0174 is revoked and the DeprecationWarning is replaced with a regular process warning using the code PROMISIFY_RETURNED_PROMISE. The warning is now emitted once per promisified function rather than on every call, and can be silenced with --disable-warning=PROMISIFY_RETURNED_PROMISE.

Rejections of the returned Promise are now forwarded to the promise returned by the promisified function instead of being left unhandled. If the callback has already settled the result, the rejection is rethrown so that it is still reported as an unhandled rejection rather than silently swallowed.

Refs: #49609
Refs: #49647
Refs: #49607

Calling a promisified function whose original returns a Promise is a
likely mistake rather than use of a deprecated API, so DEP0174 is
revoked and the DeprecationWarning is replaced with a regular process
warning using the code PROMISIFY_RETURNED_PROMISE. The warning is now
emitted once per promisified function rather than on every call, and
can be silenced with --disable-warning=PROMISIFY_RETURNED_PROMISE.

Rejections of the returned Promise are now forwarded to the promise
returned by the promisified function instead of being left unhandled.
If the callback has already settled the result, the rejection is
rethrown so that it is still reported as an unhandled rejection rather
than silently swallowed.

Refs: nodejs#49609
Refs: nodejs#49647
Refs: nodejs#49607
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell
jasnell requested review from a team and aduh95 November 15, 2026 16:29
@jasnell jasnell added semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/userland-migrations

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Nov 15, 2026
Comment thread doc/api/deprecations.md Resolved
Comment thread doc/api/util.md Resolved
Co-authored-by: James M Snell <jasnell@gmail.com>
@jasnell jasnell added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Nov 15, 2026
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (d105ef7) to head (7617db6).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67489      +/-   ##
==========================================
- Coverage   90.67%   90.65%   -0.02%     
==========================================
  Files         799      799              
  Lines      280245   280263      +18     
  Branches    54125    54120       -5     
==========================================
- Hits       254100   254084      -16     
- Misses      16280    16297      +17     
- Partials     9865     9882      +17     
Files with missing lines Coverage Δ
lib/internal/util.js 98.32% <100.00%> (-0.68%) ⬇️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gurgunday gurgunday added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. deprecations Issues and PRs related to deprecations. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants