-
Notifications
You must be signed in to change notification settings - Fork 886
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
Uploading files with a content size >~ 2.1 GB do not restart properly #5468
Comments
Thank you for your report. I will go ahead and label this as a bug while we attempt to replicate the issue. |
@kaloramik Is using Amplify a possibility for you? Amplify uses the latest feature sets and has lot of improvements compared to AWS SDK. |
@harsh62 we can, but we already have our own backend / auth setup and would prefer not onboarding on to the entire Amplify ecosystem. Do you have a link to instructions / guide on how to use Amplify as a drop-in replacement for the AWSTransferUtility? |
@harsh62 In addition, background uploading is extremely important for us. Looking at the documentation, the Amplify Upload Storage does not mention behavior when the app goes into suspension, terminated by system, or terminated by user. https://docs.amplify.aws/swift/build-a-backend/storage/upload-files/ Whereas the gen 1 system seems to lay it out more specifically https://docs.amplify.aws/gen1/swift/sdk/storage/transfer-utility/ Do you have any guarantees on reliability, especially when it comes to backgrounding, suspension, and restarts for the Amplify version? I would not want to spend a lot of time migrating just to run into issues that were solved in the Gen 1 version. |
@creitz Do you want to open a PR for the fix that you are suggesting? (Looks correct to me) |
@harsh62 just bumping the previous message on Amplify, would love to get some more info on migrating and the feature set in the new Amplify SDK, especially WRT background uploads |
@kaloramik I am working with my team to draft documentation around your question.
I will get back to you on this soon |
awesome thank you! |
Sure can do! |
@harsh62 @kaloramik I've opened #5471 |
@creitz Thanks.. I am trying to resolve a Github Actions issue with the repo and I'll get this merged once that is resolved. |
Hi @harsh62, any updates on the above? Thanks! |
@creitz I am actively working on it. Not able to provide an ECD on it yet, but will keep the ticket updated of what the progress is. |
@harsh62 appreciated! |
Also @harsh62, if the fix was merged today (or soon), when would you expect it to be in a live release? Are releases done on a schedule, or ad-hoc? Judging by AWSS3.podspec, I can't quite tell. |
@creitz |
@creitz So the pipeline fix has been merged, I updated your PR and ran the integration and unit tests.. |
@harsh62 Great, thanks! |
@creitz Release is in progress.. SPM is complete, Cococapods might take a couple hours more. |
So my teammate came back and they confirmed that Amplify V2 doesn't have the same level of features that were available in TransferUtility. This is something that Amplify team will prioritize in the coming releases. For now, I hope @creitz contribution could fix your issue. |
I see, Thanks for the update @harsh62. For my own information, is the Transfer Utility / aws ios SDK something you guys are planning on supporting long term? My ideal would be that it is a library on its own that Amplify V2 calls under the hood, and so it would be maintained / upgraded as a part of Amplify vs ditching it for an alternative. Also, is there a way for us to use the Amplify Upload Storage capabilities without having to onboard onto the full Amplify Stack? (AKA using it as a library as we do now) |
Yes. You'll see new release commits get pushed onto the repo.. The Cocoapods release is still in progress. |
@kaloramik Long term plan is to use Swift SDK in favor of this repo. The team will share plans on the future of this repo soon. As for why Transfer Utility features are not available is something that the team is discussing internally (probably a miss when Amplify V2 was created). For the 2nd question, you can use Amplify Storage or any other plugin without setting up Amplify Stack as follows:
You wanna probably add Auth too as Storage fetches credentials from there (user pool and/or identity pool), its a similar process:
|
Oh interesting, what is the status of the Swift SDK you mentioned? Would you recommend migration to that now (is there parity with the |
The AWS Swift SDK is now generally available and suitable for production use. In fact, Amplify Swift relies on the Swift SDK as a dependency under the hood. It’s important to note that the AWS SDK for iOS and the AWS SDK for Swift are fundamentally different and not interchangeable. Depending on the features you need, you could either use Amplify (leveraging the Swift SDK for unsupported features) or directly adopt the AWS SDK for Swift and implement your own logic where necessary. The AWS SDK for Swift provides a direct interface to AWS APIs, plus additional platform-specific functionality. Amplify Swift, on the other hand, is an abstraction layer that builds its own APIs on top of the Swift SDK—sometimes involving multiple AWS APIs to deliver a single feature. Because these approaches differ substantially, there isn’t a straightforward, one-size-fits-all migration guide. Your migration strategy will depend on your specific requirements and goals. I recommend exploring your options and planning your approach as soon as possible. |
@harsh62 thanks for the details and for letting me know! |
Describe the bug
I am utilizing the behavior in the Swift TransferUtility documentation here https://docs.amplify.aws/gen1/swift/sdk/storage/transfer-utility/#managing-transfers-when-an-app-restarts
I have tested this with a 1.75 GB file and a 2.3 GB file. It seems to work correctly for the 1.75 GB file, but not for the 2.3 GB file.
In the 2.3 GB case, the contentLength gets changed to something negative. One possible hypothesis could be that 2.3 GB is larger than the size of a 32 bit signed int?
To Reproduce
Base case
Steps to reproduce the behavior:
task.contentLength
is negativeObserved Behavior
see above
Expected Behavior
A clear and concise description of what you expected to happen.
Stack Trace
Please provide a stack trace if applicable e.g. a crash is occurring.
I am logging to Datadog here
you can see here where after the app restarts, the contentLength changes
Note that the original content length was
2332786803
. the new content length is-1962180493
This is the value of the former as a signed intCode Snippet
I have generally followed the same instructions in the AutoResume sample app
Unique Configuration
If you are reporting an issue with a unique configuration or where configuration can make a difference in code execution (i.e. Cognito) please provide your configuration. Please make sure to obfuscate sensitive information from the configuration before posting.
Areas of the SDK you are using (AWSMobileClient, Cognito, Pinpoint, IoT, etc)?
Screenshots
If applicable, add screenshots to help explain your problem.
Environment(please complete the following information):
Device Information (please complete the following information):
Additional context
Add any other context about the problem here like your specific use case.
Relevant Console Output
In some cases, it might be helpful to add any logs from your console that better help you tell the story of this issue. You can easily enable logging in your app by putting the following code in your app delegate.
Logs
Please logs in the code block below. (See: Logs Guidance)
Log Messages
The text was updated successfully, but these errors were encountered: