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

fix: make sure the handler resolves in all cases #507

Merged
merged 28 commits into from
Mar 7, 2024

Conversation

gurgunday
Copy link
Member

@gurgunday gurgunday commented Jan 31, 2024

partially fixes #497

The request still freezes without the try catch and I'm not sure how we could remedy that

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it was a wrong choice to use while for generator.
I knew it will cause problem somehow, that's why I prefer to use AsyncIterator

Something similar can be done by,
https://github.com/kaka-ng/fastify-plugins/blob/main/packages/multipart/lib/adapter/busboy.ts#L116-L156

test/multipart.test.js Outdated Show resolved Hide resolved
@gurgunday
Copy link
Member Author

I don't get an error on node 16, 18, 20, or 21

What is up with 14?..

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Member

mcollina commented Feb 8, 2024

Seems there are issue on Node v14

@gurgunday
Copy link
Member Author

gurgunday commented Feb 8, 2024

Should I merge to next?

@Uzlopak
Copy link
Contributor

Uzlopak commented Feb 8, 2024

@gurgunday

Can you shortly describe why it fails on 14?

@gurgunday
Copy link
Member Author

gurgunday commented Feb 8, 2024

I can't for the moment 🤣

Essentially, the test I added doesn't pass on node 14 (time outs I believe), and it needs investigation

@gurgunday
Copy link
Member Author

gurgunday commented Feb 8, 2024

Note that it's not because of what this PR does, it's because the PR doesn't seem to fix the issue on node 14

@gurgunday
Copy link
Member Author

Seems like on node 14 request.raw.on('error') is not firing... anyone has a guess on why that might be? Was it added recently?

@mcollina
Copy link
Member

mcollina commented Feb 23, 2024

I think the destroy logic in v14 is really different. Maybe let's target next?

@gurgunday gurgunday changed the base branch from master to next February 23, 2024 09:35
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

@gurgunday gurgunday merged commit 529276a into fastify:next Mar 7, 2024
14 checks passed
@gurgunday gurgunday deleted the fix-error branch March 7, 2024 09:28
@gurgunday
Copy link
Member Author

gurgunday commented Mar 7, 2024

Will cut a patch

I can't because it's on next

@mcollina
Copy link
Member

mcollina commented Mar 7, 2024

a patch? This is in the next branch? Is that ready to ship?

@gurgunday
Copy link
Member Author

a patch? This is in the next branch? Is that ready to ship?

Yeah, forgot for a second

It's not ready IMO, we can wait till v5 since maybe I'll be able to do the major rewrite... unless someone needs this patch ASAP

@joelmukuthu
Copy link

Thanks @gurgunday (and reviewers) for working on this fix. I understand that there are some issues with getting this released due to node 14, but is there any chance to get this released in a bug-fix release? Or do you have a rough timeline for the v5 release?

@gurgunday
Copy link
Member Author

@mcollina, should I add a skip to the test and backport it to main? Or would you prefer releasing next?

jsumners pushed a commit that referenced this pull request Jul 15, 2024
* fix error in processing file

* fix error in processing file

* add test

* fix close

* fix test

* lint

* revert change

* Revert "revert change"

This reverts commit 17ec56c.

* node 14 :(

* node 14 :(

* add file

* use filePath

* delete foo

* revert change

* remove console.log

* add test number

* increase timeout

* try fixing the error

* try fixing the error

* try reverting?

* Revert "try reverting?"

This reverts commit 35aca1e.

* 90

* fix error

* fix error

* let request aborted destroy the file

* simplify

* simplify

* ci
jsumners pushed a commit that referenced this pull request Jul 15, 2024
* fix error in processing file

* fix error in processing file

* add test

* fix close

* fix test

* lint

* revert change

* Revert "revert change"

This reverts commit 17ec56c.

* node 14 :(

* node 14 :(

* add file

* use filePath

* delete foo

* revert change

* remove console.log

* add test number

* increase timeout

* try fixing the error

* try fixing the error

* try reverting?

* Revert "try reverting?"

This reverts commit 35aca1e.

* 90

* fix error

* fix error

* let request aborted destroy the file

* simplify

* simplify

* ci
jsumners added a commit that referenced this pull request Jul 17, 2024
* update for Fastify v5 (#505)

* fix: make sure the handler resolves in all cases (#507)

* fix error in processing file

* fix error in processing file

* add test

* fix close

* fix test

* lint

* revert change

* Revert "revert change"

This reverts commit 17ec56c.

* node 14 :(

* node 14 :(

* add file

* use filePath

* delete foo

* revert change

* remove console.log

* add test number

* increase timeout

* try fixing the error

* try fixing the error

* try reverting?

* Revert "try reverting?"

This reverts commit 35aca1e.

* 90

* fix error

* fix error

* let request aborted destroy the file

* simplify

* simplify

* ci

* update for Fastify v5 (#505)

* fix: make sure the handler resolves in all cases (#507)

* fix error in processing file

* fix error in processing file

* add test

* fix close

* fix test

* lint

* revert change

* Revert "revert change"

This reverts commit 17ec56c.

* node 14 :(

* node 14 :(

* add file

* use filePath

* delete foo

* revert change

* remove console.log

* add test number

* increase timeout

* try fixing the error

* try fixing the error

* try reverting?

* Revert "try reverting?"

This reverts commit 35aca1e.

* 90

* fix error

* fix error

* let request aborted destroy the file

* simplify

* simplify

* ci

* update fastify deps

* update for Fastify v5 (#505)

* fix: make sure the handler resolves in all cases (#507)

* fix error in processing file

* fix error in processing file

* add test

* fix close

* fix test

* lint

* revert change

* Revert "revert change"

This reverts commit 17ec56c.

* node 14 :(

* node 14 :(

* add file

* use filePath

* delete foo

* revert change

* remove console.log

* add test number

* increase timeout

* try fixing the error

* try fixing the error

* try reverting?

* Revert "try reverting?"

This reverts commit 35aca1e.

* 90

* fix error

* fix error

* let request aborted destroy the file

* simplify

* simplify

* ci

* Update index.js

Co-authored-by: Gürgün Dayıoğlu <[email protected]>
Signed-off-by: James Sumners <[email protected]>

---------

Signed-off-by: James Sumners <[email protected]>
Co-authored-by: Gürgün Dayıoğlu <[email protected]>
Co-authored-by: Gürgün Dayıoğlu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request hangs if an error is thrown while processing a file
5 participants