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

Cache files left when AWSS3TransferUtilityMultiPartUploadTask canceled #1576

Open
SGA-ou-enhaku opened this issue May 28, 2019 · 4 comments
Open
Labels
feature-request Request a new feature s3 Issues related to S3 work in progress Issues was triaged and investigation done

Comments

@SGA-ou-enhaku
Copy link

SGA-ou-enhaku commented May 28, 2019

Describe the bug
After [AWSS3TransferUtilityMultiPartUploadTask cancel] calling of big file such as 60MB, there are cache files left in /Library/Caches/S3TransferUtility.
If [S3TransferUtility uploadFileUsingMultiPart:...] -> [task cancel] all the time, there would be bad for iPhone' storage.

To Reproduce
Steps to reproduce the behavior:

  1. Call [S3TransferUtility uploadFileUsingMultiPart:...]
  2. Call [AWSS3TransferUtilityMultiPartUploadTask cancel]
  3. Go to (App)/Library/Caches/S3TransferUtility
  4. See the left cache files

Which AWS service(s) are affected?
S3

Expected behavior
A clear and concise description of what you expected to happen.
Cache files should be deleted.

Environment(please complete the following information):

  • SDK Version: [2.9.8 and 2.8.2]
  • Dependency Manager: [Cocoapods]
  • Objective-C

Device Information (please complete the following information):

  • Device: [iPhoneXR, Simulator]
  • iOS Version: [iOS 12.1]
@mutablealligator mutablealligator added the s3 Issues related to S3 label May 28, 2019
@minbi
Copy link
Contributor

minbi commented May 28, 2019

Hi @SGA-ou-enhaku ,

Thanks for bringing this to our attention. This would be an agreeable improvement to the current behavior. We will look into prioritizing this item. In the meantime, we are open to pull requests if you are interested.

@minbi minbi added the feature-request Request a new feature label May 28, 2019
@pablogeek
Copy link

I'm also having this. Please how could we remove the cache?

@pablogeek
Copy link

this code solved my issue, I run this everytime something is correctly uploaded

    func cleanCache(){
        if let url = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first {
            let urls = try?  FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: nil, options: .skipsSubdirectoryDescendants)
            urls?.filter { $0.lastPathComponent.contains("S3") }.forEach { try? FileManager.default.removeItem(at: $0) }
        }
    }

@Guolanlan
Copy link

yes,you can call suspend and it will pause,no remove cache

@atierian atierian added the work in progress Issues was triaged and investigation done label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature s3 Issues related to S3 work in progress Issues was triaged and investigation done
Projects
None yet
Development

No branches or pull requests

7 participants