Skip to content

Conversation

@ua741
Copy link
Member

@ua741 ua741 commented Nov 18, 2025

Description

Copying large files was resulting in EntityTooLarge error.

Tests

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +250 to +253
// Step 2: Upload parts
fileSize := req.SourceS3Object.FileSize
numParts := (fileSize + multipartCopyPartSize - 1) / multipartCopyPartSize
completedParts := make([]*s3.CompletedPart, numParts)

Choose a reason for hiding this comment

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

P0 Badge Convert numParts to int before building completedParts slice

The new multipart copy implementation declares numParts := (fileSize + multipartCopyPartSize - 1) / multipartCopyPartSize as an int64, and then uses it both as the length argument to make and as the index variable (completedParts[i]). Go’s make and slice indices require int, so this file no longer compiles (cannot use numParts (type int64) as type int). Until numParts (and the loop index) are converted to int, copyS3ObjectMultipart cannot even build, preventing the server from compiling at all.

Useful? React with 👍 / 👎.

@ua741
Copy link
Member Author

ua741 commented Nov 18, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +251 to +254
fileSize := req.SourceS3Object.FileSize
numParts := (fileSize + multipartCopyPartSize - 1) / multipartCopyPartSize
completedParts := make([]*s3.CompletedPart, numParts)

Choose a reason for hiding this comment

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

P1 Badge Convert numParts to int before slicing

The new multipart helper declares numParts := (fileSize + multipartCopyPartSize - 1) / multipartCopyPartSize as an int64 and then passes it directly to make([]*s3.CompletedPart, numParts). In Go the length argument to make must be of type int, so this code does not compile (cannot use numParts (variable of type int64) as type int). As written the server cannot be built, so the copy fix never ships. Cast numParts to int (or derive the slice length from len) before calling make.

Useful? React with 👍 / 👎.

Comment on lines +283 to +286
}

completedParts[i] = &s3.CompletedPart{
ETag: uploadPartOutput.CopyPartResult.ETag,

Choose a reason for hiding this comment

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

P1 Badge Loop index type prevents slice indexing

Inside the multipart copy loop i is declared as int64 (for i := int64(0); i < numParts; i++ {) but later used to index completedParts (completedParts[i] = …). Slice indices must be of type int, so this line also fails to compile (invalid operation: cannot use i (variable of type int64) as type int). Until the index is converted to int (or the loop is rewritten to use an int counter), the new multipart copy implementation cannot be built or run.

Useful? React with 👍 / 👎.

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.

2 participants