undici icon indicating copy to clipboard operation
undici copied to clipboard

undici - next

Open ronag opened this issue 4 months ago • 11 comments

TODO:

  • [x] remove anti-pattern dispatcher hooks
  • [x] remove old interceptor pattern (https://github.com/nodejs/undici/pull/2754)
  • [x] new interceptor pattern (https://github.com/nodejs/undici/pull/2795)
  • [ ] change so that dispatcher hooks take an options object instead of multiple arguments
  • [ ] remove pipelining retries from core
  • [ ] implement "idempotent" retry interceptor for pipeline resets
  • [x] separate out http2
  • [ ] move throwOnError to interceptor
  • [ ] move signal handling to interceptor
  • [x] make dump investigate content-length to see if it's worth trying to read
  • [ ] move dump to interceptor - #3118
  • [ ] fix Readable.setEncoding issue (https://github.com/nodejs/undici/issues/1125#issuecomment-987724800)
  • ~~[x] non-keep alive connections are not data safe~~
  • ~~[ ] Should we split onHeaders into more fine-grained hooks? i.e. onHeader(key, val) and onStatus(code, message)?~~

Refs: https://github.com/nodejs/undici/issues/2722

ronag avatar Feb 25 '24 09:02 ronag

@metcoder95

ronag avatar Feb 25 '24 09:02 ronag

With dispatcher hooks do you refer to interceptors?

metcoder95 avatar Feb 25 '24 09:02 metcoder95

With dispatcher hooks do you refer to interceptors?

It's methods on Dispatcher, i.e. onHeaders etc...

ronag avatar Feb 25 '24 10:02 ronag

Some of the above we can probably land on main.

ronag avatar Feb 25 '24 10:02 ronag

Should we split onHeaders into more fine-grained hooks? i.e. onHeader(key, val) and onStatus(code, message)?

This seems interesting, in theory, the HTTP response is split into three parts, the status line, headers and body; maybe we can follow this line? See potential use cases, specially around stop request processing if the status is not the one expected

metcoder95 avatar Feb 25 '24 10:02 metcoder95

This seems interesting, in theory, the HTTP response is split into three parts, the status line, headers and body; maybe we can follow this line?

it's actually headers first, then status and then body.

ronag avatar Feb 25 '24 10:02 ronag

I'm working on the dump to interceptor, but I'm curious what do you have in mind for that API?

Also removing the legacy interceptor concepts from next, but is out of sync, should I open aim the branch anyways in this state?

metcoder95 avatar Apr 07 '24 09:04 metcoder95

cc: @ronag

metcoder95 avatar Apr 07 '24 09:04 metcoder95

I will sort the next branch sometime in the next two weeks. Just open or against current state.

ronag avatar Apr 07 '24 09:04 ronag

I'm working on the dump to interceptor, but I'm curious what do you have in mind for that API?

.compose(interceptors.dump({ maxSize: 1024 * 1024 }))

Something like that?

ronag avatar Apr 07 '24 11:04 ronag

It is also necessary to move the decompression of compressed data (gzip, deflate, br, zstd) into a separate interceptor

PandaWorker avatar May 02 '24 14:05 PandaWorker