Skip to content

Conversation

@designcode
Copy link
Collaborator

@designcode designcode commented Feb 6, 2026

Note

Low Risk
Small, localized change to post-upload metadata calculation; main risk is an extra HEAD request and potential new error surface if it fails.

Overview
Fixes put() so returned size is no longer 0 when upload progress doesn’t provide total.

After a successful upload, if contentSize is still unknown, put() now calls head() on the uploaded object and uses ContentLength to populate the response.

Written by Cursor Bugbot for commit bcbd856. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

  • Updates put() to fallback to a head() request after upload when contentSize can’t be inferred from upload progress.
  • This keeps the returned PutResponse.size more accurate for cases where the SDK doesn’t provide progress.total.
  • Change is localized to packages/storage/src/lib/object/put.ts and uses existing head() helper with the same config/bucket resolution.

Confidence Score: 4/5

  • Mostly safe to merge, but the size fallback path can mask HEAD failures and return an incorrect size without surfacing an error.
  • Change is small and localized; main concern is the reachable success-path behavior when HEAD fails after upload and contentSize remains 0, which can mislead callers relying on PutResponse.size.
  • packages/storage/src/lib/object/put.ts

Important Files Changed

Filename Overview
packages/storage/src/lib/object/put.ts Adds post-upload fallback to fetch object size via HEAD when contentSize couldn't be inferred from upload progress.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@designcode designcode merged commit 7aeb925 into main Feb 6, 2026
1 of 2 checks passed
@designcode designcode deleted the storage/fix-put-content-size branch February 6, 2026 13:15
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🎉 This PR is included in version 2.12.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants