Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload utility class API should allow us to have FULL_OBJECT checksum check #6891

Open
2 tasks done
kasir-barati opened this issue Feb 17, 2025 · 2 comments
Open
2 tasks done
Assignees
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue

Comments

@kasir-barati
Copy link

Describe the feature

I need to check the uploaded file's integrity. I get an stream of data, so I was also hoping to see a more intuitive API. I mean right now I have to calculate the checksum of the entire file first since I need it when I am instantiating a new instance of this class.

It is somewhat related to this issue: #6742

Use Case

What this means in a real world application is that my client has to read the file twice which does not make sense;

  1. I am gonna ask for the checksum (need it here):
  2. They will stream the file!
new Upload({
  ...,
  params: {
    ChecksumCRC32: "some checksum",
    Body: passThroughStream
  }
})

So it would be great if we could just pass the checksum for a FULL_OBJECT checksum check at the end.

Proposed Solution

new Upload({
  ...,
  params: {
    ChecksumCRC32: "some checksum",
    Body: passThroughStream,
    ChecksumType: "FULL_OBJECT",
  }
})

So now here and other places you can do a simple check, if ChecksumType is FULL_OBJECT you can skip attaching this params to the request.

Same can be applied to the rest of the places you're simply spreading whatever developer passes to the params.

Other Information

I like to contribute but to me your codebase looked like it's been generated from a python code. So I am not entirely sure how this SDK is being developed and maintained.

And I really like to know when do you think you can address this feature request.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

3.749.0

Environment details (OS name and version, etc.)

Linux, Ubuntu 24.04.01

@kasir-barati kasir-barati added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Feb 17, 2025
@kasir-barati
Copy link
Author

kasir-barati commented Feb 18, 2025

Workarounds

  1. Using middleware: https://github.com/kasir-barati/bugs/blob/db72dbcb8f2b9c832370ea08c063b80d69912d56/upload1.ts

  2. This is the modified version which is doing the job but it is dirty and just a POC: kasir-barati/bugs@cdd3342

    And this is how you can use it: https://github.com/kasir-barati/bugs/blob/db72dbcb8f2b9c832370ea08c063b80d69912d56/upload2.ts#L72-L74

@zshzbh zshzbh self-assigned this Feb 20, 2025
@zshzbh
Copy link
Contributor

zshzbh commented Feb 20, 2025

Thanks for the feedback. I will forward this to the service team.

@kasir-barati Thanks for providing the workaround!

@zshzbh zshzbh added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants