Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undici - next #2835

Open
5 of 12 tasks
ronag opened this issue Feb 25, 2024 · 11 comments
Open
5 of 12 tasks

undici - next #2835

ronag opened this issue Feb 25, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@ronag
Copy link
Member

ronag commented Feb 25, 2024

TODO:

  • remove anti-pattern dispatcher hooks
  • remove old interceptor pattern (refactor(#2722)!: Drop Interceptors support #2754)
  • new interceptor pattern (Dispatch compose #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
  • separate out http2
  • move throwOnError to interceptor
  • move signal handling to interceptor
  • make dump investigate content-length to see if it's worth trying to read
  • move dump to interceptor - feat: dump interceptor #3118
  • fix Readable.setEncoding issue (client.request throws Error with setEncoding #1125 (comment))
  • [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: #2722

@ronag ronag added the enhancement New feature or request label Feb 25, 2024
@ronag
Copy link
Member Author

ronag commented Feb 25, 2024

@metcoder95

@metcoder95
Copy link
Member

With dispatcher hooks do you refer to interceptors?

@ronag
Copy link
Member Author

ronag commented Feb 25, 2024

With dispatcher hooks do you refer to interceptors?

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

@ronag
Copy link
Member Author

ronag commented Feb 25, 2024

Some of the above we can probably land on main.

@metcoder95
Copy link
Member

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

@ronag
Copy link
Member Author

ronag commented Feb 25, 2024

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.

@metcoder95
Copy link
Member

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
Copy link
Member

cc: @ronag

@ronag
Copy link
Member Author

ronag commented Apr 7, 2024

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

@ronag
Copy link
Member Author

ronag commented Apr 7, 2024

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?

@metcoder95 metcoder95 pinned this issue Apr 14, 2024
@PandaWorker
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants