-
Notifications
You must be signed in to change notification settings - Fork 206
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
Amplify S3 Uploads Retain Cached Data, Leading to High Storage Usage #3959
Comments
Thank you for the report. I'll go ahead and label this as a bug while we reproduce. |
@tylerjroach any updates on this? |
@zamzamfp unfortunately, we don't have any updates on this yet. We'll be sure to update the issue once we have an update. |
@zamzamfp I created a draft PR. I am trying to test different scenarios just to make sure it doesn't break anything else. It would be nice if you could pull in the WIP branch and validate it fixes your issue. I will review the fix internally within our team and provide an update soon. |
@harsh62 that's great news 🙂 I will test it on our end and let you know our findings. |
Describe the bug
When using Amplify to upload large files to S3, the SDK caches the file data during the upload process. While it does not pre-cache the entire file at the beginning like AWS SDK for iOS, it still retains uploaded chunks in cache without clearing them after each part is successfully uploaded.
Also, if an upload is canceled, the temporary cached data is not automatically deleted, which leads to unnecessary disk usage. Over time, this can significantly increase storage consumption on the device, particularly for large file uploads.
The code for upload
let uploadTask = Amplify.Storage.uploadFile( path: .fromString(remoteName), local: recording.url )
The code for canceling the upload
uploadTask.cancel()
Steps To Reproduce
Expected behavior
Amplify Framework Version
2.45.4
Amplify Categories
Storage
Dependency manager
Swift PM
Swift version
Swift 5
CLI version
Xcode version
16.0
Relevant log output
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 18.0
Device
iPhone 12
Specific to simulators
No response
Additional context
This issue was previously raised in the AWS iOS SDK repository (aws-sdk-ios Issue #5439).
The text was updated successfully, but these errors were encountered: