Skip to content

Conversation

@itslenny
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

If an upload stream closes prematurely the exception is not caught in the uploader

What is the new behavior?

Detect closed stream in uploader and return 400 error:

{"statusCode":"400","error":"InvalidRequest","message":"Request stream closed before upload could begin"}

Additional context

Uses patched fork of fastify/multipart v8.3.1 (patched) which prevents emitting unhandled errors

@coveralls
Copy link

Pull Request Test Coverage Report for Build 18829200819

Details

  • 7 of 9 (77.78%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 76.363%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/uploader.ts 7 9 77.78%
Totals Coverage Status
Change from base Build 18706939977: -0.001%
Covered Lines: 21182
Relevant Lines: 27505

💛 - Coveralls

@fenos fenos merged commit f624371 into master Oct 28, 2025
2 checks passed
@fenos fenos deleted the fix/gracefully-handle-incomplete-multipart-uploads branch October 28, 2025 07:07
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.

3 participants