Skip to content

Move fs operations into the destroy method#692

Merged
GrosSacASac merged 1 commit into
node-formidable:masterfrom
akindr:issue/691
Mar 3, 2021
Merged

Move fs operations into the destroy method#692
GrosSacASac merged 1 commit into
node-formidable:masterfrom
akindr:issue/691

Conversation

@akindr

@akindr akindr commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

This fixes the uncaught exception thrown for VolatileFiles (re: file streams) when the connection is aborted.

This is the proper location to be doing fs operations, since VolatileFile has no fs presence, while PersistentFile does. I also removed the setTimeout call because fs.unlink is already an async operation.

I am curious though if we should propagate an error from fs.unlink or not.

Fixes #691

@akindr

akindr commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

Hmm not sure why this is failing lint rules - they seem unrelated to this PR

@GrosSacASac

Copy link
Copy Markdown
Contributor

Thanks

@akindr

akindr commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

No problem! Let me know if these tests / lint rules are failing due to this PR and if there's anything else I can do.

@GrosSacASac GrosSacASac merged commit 997e852 into node-formidable:master Mar 3, 2021
@GrosSacASac

Copy link
Copy Markdown
Contributor

The failing test are because I rushed the conversion to jest

@akindr

akindr commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

ok cool, ty!

@GrosSacASac

Copy link
Copy Markdown
Contributor

If you have time try to test #689

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.

HTTP request abort crashes server when using VolatileFile (streaming)

2 participants