Skip to content

feat(drive): support multipart upload for files larger than 20MB#43

Open
xoyowade wants to merge 1 commit intolarksuite:mainfrom
xoyowade:fix/drive-multipart-upload
Open

feat(drive): support multipart upload for files larger than 20MB#43
xoyowade wants to merge 1 commit intolarksuite:mainfrom
xoyowade:fix/drive-multipart-upload

Conversation

@xoyowade
Copy link
Copy Markdown

@xoyowade xoyowade commented Mar 29, 2026

Summary

  • drive +upload previously rejected files exceeding 20MB with a validation error
  • Now files > 20MB automatically use the three-step chunked upload API (upload_prepareupload_part × N → upload_finish), removing the size ceiling for Drive uploads
  • Small files (≤ 20MB) continue to use the single-request upload_all endpoint unchanged

Test plan

  • Unit test TestDriveUploadLargeFileUsesMultipart validates the full 3-step multipart flow with mocked API responses
  • All existing drive tests continue to pass
  • Real upload tested: 189MB file → 48 blocks × 4MB, successfully uploaded to a live Feishu tenant (file_token: LVb3bP6Nmo6EoKxzwgbcPz4xnCe)
  • Small file (5MB) verified to still use single upload_all path

🤖 Generated with Claude Code

Previously, `drive +upload` rejected files exceeding 20MB with a
validation error. Now files > 20MB automatically use the three-step
chunked upload API (upload_prepare → upload_part × N → upload_finish),
removing the size ceiling for Drive uploads.

Tested with a 189MB file (48 blocks × 4MB) against a live Feishu tenant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xoyowade xoyowade force-pushed the fix/drive-multipart-upload branch from cbabb27 to 4cdd113 Compare March 29, 2026 02:58
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 30, 2026

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 60.56338% with 28 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@d2ad5e4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
shortcuts/drive/drive_upload.go 60.56% 18 Missing and 10 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #43   +/-   ##
=======================================
  Coverage        ?   47.94%           
=======================================
  Files           ?      280           
  Lines           ?    23045           
  Branches        ?        0           
=======================================
  Hits            ?    11048           
  Misses          ?    11004           
  Partials        ?      993           

☔ 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.

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