Giter VIP home page Giter VIP logo

Comments (6)

mertcanaltin avatar mertcanaltin commented on May 23, 2024 1

I can take care of this issue if it's appropriate

from undici.

jackschu avatar jackschu commented on May 23, 2024 1

Sure I can look at adding this patch + some test coverage, It'll likely be outside of my working hours so may be a week or so

from undici.

mertcanaltin avatar mertcanaltin commented on May 23, 2024 1

I opened a pr thank you very much for your support and explanations I hope I did it right if you have any suggestions please do not hesitate @metcoder95 @jackschu

from undici.

metcoder95 avatar metcoder95 commented on May 23, 2024

Yeah, that's a good catch and indeed a bug. Both belong to a single stream that is most likely tight to a single request/response lifecycle for fetch and undici itself.

There's no reason to reuse the same, it was most likely left over we forgot to check.

Would you like to send a PR? It might be hard, but let's see if we can add some tests.

from undici.

jackschu avatar jackschu commented on May 23, 2024

I took a swing at this but am running into some trouble around ClientDestroyedError

Currently something like this would result in the promise hanging, I don't think that's correct, and should instead result in a reject

  client.on('connect', () => {
    client.close()
  })
  await client.request({
    path: '/',
    method: 'GET',
  })

but just calling errorRequest on error in client.js's stream error handler results in a ClientDestroyedError seemingly if the client is closed without the body having been consumed eg the following will throw

  await client.request({
    path: '/',
    method: 'GET',
  })
  await client.close()

Any advice around how to handle this?

from undici.

metcoder95 avatar metcoder95 commented on May 23, 2024

Can you provide the full
Minimum Reproducible Example?

Feel free to also open a PR and we can iterate from it

from undici.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.