Skip to content

fix: Ensure we drain the request data stream completely, even if we realize it is too large - #3291

Merged
nielsenko merged 1 commit into
serverpod:mainfrom
nielsenko:fix-3213-error-during-request-read
Mar 10, 2025
Merged

nielsenko merged 1 commit into
serverpod:mainfrom
nielsenko:fix-3213-error-during-request-read

Conversation

@nielsenko

@nielsenko nielsenko commented Mar 7, 2025 •

Copy link
Copy Markdown
Collaborator

This is a workaround to dart-lang/sdk#60271

fix: #3213

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

@nielsenko nielsenko changed the title fix:Ensure we drain the request data stream completely, even if we realize it is too large fix: Ensure we drain the request data stream completely, even if we realize it is too large Mar 7, 2025
@nielsenko
nielsenko force-pushed the fix-3213-error-during-request-read branch 2 times, most recently from 0d60727 to 6b75fd2 Compare March 8, 2025 10:11

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! 👍

Single suggestion/discussion for improved readability

@nielsenko
nielsenko force-pushed the fix-3213-error-during-request-read branch from 6b75fd2 to 29097a5 Compare March 10, 2025 07:15
performance:
- Don't start reading, if contentLenght is too large
- Use BytesBuffer copy flag to avoid copying data
- Use takeBytes to avoid copying data

- Ensure we drain the request data stream completely, even if we realize it is too large
- Add e2e test for request too large

This is a workaround to dart-lang/sdk#60271
@nielsenko
nielsenko force-pushed the fix-3213-error-during-request-read branch from 29097a5 to d5c76ab Compare March 10, 2025 08:35
@nielsenko
nielsenko merged commit cf14157 into serverpod:main Mar 10, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ByteData Serialization Bug (Image Upload)

2 participants