Skip to content

Comments

fix(nestjs-tools-fastify-upload): file interceptor should process all multipart fields#109

Merged
getlarge merged 7 commits intomainfrom
fix/fastify-upload-file-interceptor-body-fields
Feb 3, 2026
Merged

fix(nestjs-tools-fastify-upload): file interceptor should process all multipart fields#109
getlarge merged 7 commits intomainfrom
fix/fastify-upload-file-interceptor-body-fields

Conversation

@getlarge
Copy link
Owner

@getlarge getlarge commented Feb 2, 2026

Summary

  • Modified FileInterceptor to iterate through all multipart parts instead of only processing the first one
  • Body fields are now correctly captured regardless of field order
  • Maintains strict single-file validation (rejects multiple files, wrong fieldnames)

Changes

  • Updated handleMultipartSingleFile to use for await loop (matching the pattern in handleMultipartMultipleFiles)
  • Added test endpoint to verify body field extraction
  • Comprehensive test coverage for new functionality and error cases

Test Plan

  • All existing tests pass (backward compatibility verified)
  • New test: Upload file with body fields
  • New test: Upload file when body fields come first (order independence)
  • New test: Reject multiple files on same field
  • New test: Reject file with wrong fieldname
  • Linting passes
  • Build succeeds

Fixes

Closes #107

🤖 Generated with Claude Code

getlarge and others added 2 commits February 2, 2026 22:35
… multipart fields

Fixes #107

Changes:
- Modified handleMultipartSingleFile to iterate through all parts instead of only the first
- Body fields are now correctly captured regardless of order
- Maintains strict validation (rejects multiple files, wrong fieldnames)
- All existing tests pass (backward compatible)

Added tests:
- Upload file with body fields
- Upload file when body fields come first (order independence)
- Reject multiple files on same field
- Reject file with wrong fieldname

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@getlarge getlarge marked this pull request as ready for review February 3, 2026 07:15
getlarge and others added 2 commits February 3, 2026 08:30
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add .worktrees directory to gitignore to prevent git worktree
directories from being tracked in the repository.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nx-cloud
Copy link

nx-cloud bot commented Feb 3, 2026

View your CI Pipeline Execution ↗ for commit 8f14f15

Command Status Duration Result
nx affected -t lint,test,build --parallel=2 ✅ Succeeded 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-03 08:31:40 UTC

getlarge and others added 3 commits February 3, 2026 09:20
…tMQ 4 compatibility

RabbitMQ 4.1.0+ requires minimum frame_max of 8192, but amqplib <0.10.7
defaults to 4096, causing connection negotiation failures. This was causing
CI tests to hang with continuous reconnection attempts until timeout.

Updated peer dependency from "0.10" to ">=0.10.7" to ensure compatibility.

Fixes connection errors: "negotiated frame_max = 4096 is lower than the
minimum allowed value (8192)"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…eply-to in RabbitMQ 4

RabbitMQ 4 doesn't allow acknowledgments on the special amq.rabbitmq.reply-to
pseudo-queue. This was causing test failures with:
"PRECONDITION_FAILED - reply consumer cannot acknowledge"

When using the direct reply-to mechanism, we now force noAck=true regardless
of the user's noAck configuration, since acks are not supported on this queue.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…to with noAck=false

Add explicit warning when user configures amq.rabbitmq.reply-to with
noAck=false, which is incompatible with RabbitMQ 4.x. This helps users
understand the configuration issue before encountering runtime errors.

The warning suggests either:
- Setting noAck=true in options
- Using a custom reply queue name instead

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@getlarge getlarge merged commit dbff0bf into main Feb 3, 2026
6 of 7 checks passed
@getlarge getlarge deleted the fix/fastify-upload-file-interceptor-body-fields branch February 3, 2026 08:31
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.

fix(fastify-upload): FileInterceptor (single) should support other body too

1 participant