Skip to content

fix: s3 upload compatibility#14445

Merged
darkskygit merged 1 commit intocanaryfrom
darksky/fix-s3-upload
Feb 15, 2026
Merged

fix: s3 upload compatibility#14445
darkskygit merged 1 commit intocanaryfrom
darksky/fix-s3-upload

Conversation

@darkskygit
Copy link
Member

@darkskygit darkskygit commented Feb 15, 2026

fix #14432

PR Dependency Tree

This tree was auto-generated by Charcoal

Summary by CodeRabbit

  • Refactor
    • Improved file upload handling to ensure consistent support for different data formats during object and multipart uploads.
    • Enhanced type safety throughout storage and workflow components by removing unnecessary type assertions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

📝 Walkthrough

Walkthrough

The pull request introduces a private helper method normalizeBody() in the R2 storage provider to convert Node.js Readable streams to Web Readable streams and encode strings for s3mini compatibility. Additionally, two type assertions (as any) are removed from the S3 storage provider and copilot controller without altering runtime behavior.

Changes

Cohort / File(s) Summary
R2 Storage Stream Normalization
packages/backend/server/src/base/storage/providers/r2.ts
Added normalizeBody() helper method to standardize body handling by converting Node.js Readable streams to Web Readable streams and encoding strings. Applied in proxyPutObject() and proxyUploadPart() methods.
Type Assertion Cleanup
packages/backend/server/src/base/storage/providers/s3.ts, packages/backend/server/src/plugins/copilot/controller.ts
Removed unnecessary as any type casts from body stream in S3StorageProvider#get and return statement in GraphExecutorState handling. No functional changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With streams now flowing, Web-ready and bright,
And any casts gone, the types feel just right,
Normalization hops through the R2 provider,
S3 and Copilot both climb ever higher!
TypeScript now smiles—a cleaner delight!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title focuses on S3 upload compatibility, which aligns with the primary changes in r2.ts and s3.ts that address body stream normalization and compatibility issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into canary
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch darksky/fix-s3-upload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.49%. Comparing base (9a1f600) to head (412c2a2).
⚠️ Report is 1 commits behind head on canary.

Files with missing lines Patch % Lines
...es/backend/server/src/base/storage/providers/r2.ts 15.38% 11 Missing ⚠️
...es/backend/server/src/base/storage/providers/s3.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #14445      +/-   ##
==========================================
+ Coverage   54.42%   54.49%   +0.07%     
==========================================
  Files        2835     2835              
  Lines      153853   153864      +11     
  Branches    23194    23191       -3     
==========================================
+ Hits        83731    83850     +119     
+ Misses      66716    66610     -106     
+ Partials     3406     3404       -2     
Flag Coverage Δ
server-test 76.35% <20.00%> (+0.14%) ⬆️
unittest 33.75% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@darkskygit darkskygit merged commit 9d7f4ac into canary Feb 15, 2026
65 checks passed
@darkskygit darkskygit deleted the darksky/fix-s3-upload branch February 15, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug]: Image Upload not possible in newest Windows and Android Versions

1 participant