-
Notifications
You must be signed in to change notification settings - Fork 737
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
Retry file upload FIX #1086
Retry file upload FIX #1086
Conversation
@josueruiz7: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
Hey @josueruiz7, thanks for taking a stab at this! The thing I'm worried about with this implementation is that you still wouldn't be able to use the retry functionality with an I'm thinking we should make the What do you think of that strategy? |
What you mean is to remove the possibility to send an inputStream to the SDK? Right? |
Basically, if you use the initializer that takes an That's my thought, anyway. |
719ccdf
to
129562b
Compare
I updated the code changes to follow your suggestion, please take a look on them 👍 |
@josueruiz7 Yeah that test has been flaking a bit, rerunning it now - will get a look at the code in a bit, dealing with some other stuff at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this as a starting point - I have a few things I'd like to change before shipping (basically, not keeping the data in memory from files) but I can handle that if you'd prefer.
Sources/Apollo/GraphQLFile.swift
Outdated
|
||
guard let contentLength = GraphQLFile.getFileSize(fileURL: fileURL) else { | ||
return nil | ||
guard let fileData = try? Data(contentsOf: fileURL) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was thinking more hang on to the fileURL
- otherwise this could cause an absoltutely enormous file to get stored in memory
@josueruiz7 let me know if you want to make more changes or if you'd prefer I merge this and make them myself |
I just pushed my last change, based on your suggestion. |
Hey @designatednerd just a question, I would like to know when this fix can be released? |
Sorry, things are a bit insane on my end right now. I'll get a look at this in a bit. Hopefully out either tonight or tomorrow, no guarantees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably wind up making more specific errors here but overall this looks way better. Thank you very much for your help!
The purpose of this PR is to fix the issue in the retry handling when uploading files... the fix consist in transforming any file data or file url into a Input Stream in the Multipart Creation.