expressjs / multer

Node.js middleware for handling `multipart/form-data`.
MIT License
11.54k stars 1.05k forks source link

Node AsyncLocalStorage destroyed/lost when multer 1.4.4-lts.1 or later is used #1111

Open C-Saunders opened 2 years ago

C-Saunders commented 2 years ago

I made a simple Express app that demonstrates the problem: https://github.com/C-Saunders/multer-test

AsyncLocalStorage docs for reference

It's possible this is an issue with busboy, rather than multer. I didn't attempt to use different busboy versions because there were breaking changes between the versions used by these versions of multer, but it might be possible to untangle these.

LinusU commented 1 year ago

It would be great if you could test this using only Busboy, as you say it's probably an issue that could be fixed there 👍

C-Saunders commented 1 year ago

@LinusU I've updated the repo linked in the issue to include an endpoint that uses Busboy. It didn't reproduce this issue, so I figure either there's something in Multer that's the issue, or I didn't use Busboy close enough to how Multer uses it to reproduce the issue.