Skip to content

fix: general quality of service improvements #167

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

CodingAleCR
Copy link
Owner

No description provided.

@CodingAleCR CodingAleCR force-pushed the fix/general-qos-improvements branch from 096a4ab to 84220b8 Compare July 21, 2025 15:00
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: CopyWith Mutates Original MultipartRequest Files

The MultipartRequest.copyWith method calls file.finalize() on the original MultipartFile objects. Since finalize() consumes the file's stream and can only be called once, this makes the original request's files unusable and can result in the copied request having invalid or empty file contents if the originals were already finalized. This violates the non-mutating behavior expected from copyWith().

lib/extensions/multipart_request.dart#L25-L44

for (var file in this.files) {
clonedRequest.files.add(MultipartFile(
file.field,
file.finalize(),
file.length,
filename: file.filename,
contentType: file.contentType,
));
}
} else {
// Use the provided files
for (var file in files) {
clonedRequest.files.add(MultipartFile(
file.field,
file.finalize(),
file.length,
filename: file.filename,
contentType: file.contentType,
));
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

1 participant