parse-community / parse-server-s3-adapter

AWS S3 file storage adapter for Parse Server
Other
80 stars 83 forks source link

refactor: Migrate S3 Client from AWS SDK v2 to v3 #220

Open vahidalizad opened 1 month ago

vahidalizad commented 1 month ago

Summary

This pull request migrates the S3 client implementation from AWS SDK v2 to v3.

Changes

  1. Initialization: Updated the S3 client initialization to use S3Client from @aws-sdk/client-s3 package.
  2. Commands: Replaced v2 commands (getObject, putObject, etc.) with their v3 equivalents (GetObjectCommand, PutObjectCommand, etc.).
  3. Response Handling: Modified response handling to accommodate changes in the v3 API, particularly in how streams and buffers are managed.
  4. Testing: Added unit tests to cover new functionality and ensure compatibility with the existing codebase. Implemented mocks for offline testing using Jasmine.

Notes

References

Please review the changes and provide feedback. Thank you for your time and consideration.

Closes: #197

parse-github-assistant[bot] commented 1 month ago

Thanks for opening this pull request!

mtrezza commented 1 month ago

How should we proceed here; I suggest to first make the change in Parse Server https://github.com/parse-community/parse-server/issues/9268, release, and then update this PR?

vahidalizad commented 1 month ago

How should we proceed here; I suggest to first make the change in Parse Server parse-community/parse-server#9268, release, and then update this PR?

Yes, I agree that we should update the Parse Server first, release it, and then come back to this PR. I've also fixed the bug when running npm run test on this repo. However, I noticed that the Istanbul configuration might need some adjustments to fully support async functions. I suggest we address that after merging this PR.

vahidalizad commented 1 month ago

I've added a new pull request in the parse-server repo for the async getFileLocation function: #9271. Also, I've created a new pull request for the S3 migration to AWS SDK v3: #221.

You can decide which to merge before or after the release of parse-server.

mtrezza commented 1 month ago

Great, let's take care of https://github.com/parse-community/parse-server/pull/9271 first.