nodejs / nodejs/undici

V7 onBodySent hook

Open
#3,884 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
880
Avg merge
2d 16h
Merged PRs (30d)
68

Description

I see onBodySent hook was removed here https://github.com/nodejs/undici/pull/3878

We use the onBodySent hook, we use it to "await" the request until the data was sent on the socket, then we just resolve the promise while handling the request in the background, with some fallback to queue in case request fails.

This is useful if u have to make sure data transfer completed, and u assume that in most of the cases it will be handled successfully(with some fallback if not), and we do not really care on awaiting data processing on the other side.
Looks like it is impossible to implement it now in V7.

Is it removed completely or there are plans to bing it back at some point?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #3878 and the V7 changes that removed the onBodySent hook. Trace the current request lifecycle to determine whether an equivalent extension point exists; done requires a decided approach for restoring or replacing the hook, with documented behavior and coverage for requests whose data has been sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.