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

Move fs operations into the destroy method #692

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

akindr
Copy link
Contributor

@akindr akindr commented Mar 3, 2021

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
Copy link
Contributor Author

akindr commented Mar 3, 2021

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

@GrosSacASac
Copy link
Contributor

Thanks

@akindr
Copy link
Contributor Author

akindr commented Mar 3, 2021

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
Contributor

The failing test are because I rushed the conversion to jest

@akindr
Copy link
Contributor Author

akindr commented Mar 3, 2021

ok cool, ty!

@GrosSacASac
Copy link
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