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

Retry Uploading Files is failing #1080

Closed
josueruiz7 opened this issue Mar 13, 2020 · 7 comments
Closed

Retry Uploading Files is failing #1080

josueruiz7 opened this issue Mar 13, 2020 · 7 comments
Labels
bug Generally incorrect behavior uploading
Milestone

Comments

@josueruiz7
Copy link
Contributor

Hello Everyone,

I found an issue while using the retry handling for Uploading Files, the problem is that in the retry request call (second request call) the Files Content are not being sent in the Request, the framework is recreating the whole request in every retry call so the InputStream is not retrieving the Data once it has been already read, so in the retry call (second request) the InputStream data is nil.

The inputStream.hasBytesAvailable is always returning false in every retry call (after the first call)

while (inputStream.hasBytesAvailable) {

Maybe a fix could be recreate a new InputStream object every time we are going to create a request.

Thanks

@designatednerd
Copy link
Contributor

Ooh, yeah, because the input stream gets exhausted after it's read once. Yick.

I'll tag this as a bug, but I'll be honest, it's probably going to be a while before I can get to this. Would be happy to look at any PRs, but it does seem like the automatic retry functionality is not great for use with uploads because of this.

@designatednerd designatednerd added bug Generally incorrect behavior uploading labels Mar 13, 2020
@designatednerd
Copy link
Contributor

One thing I will note for this and all other uploading issues: One strategy we've seen have folks have better long-term success with over GQL-based uploads is uploading the file to another service (such as S3 or even your own backend) and then only sending the URL of the file via GraphQL. This is an article about the web, but it's got useful examples.

@josueruiz7
Copy link
Contributor Author

Thanks @designatednerd this is the PR #1086 with the fix that I propose, please take a look

@designatednerd designatednerd added this to the 0.24.0 milestone Mar 18, 2020
@josueruiz7
Copy link
Contributor Author

hey @designatednerd thanks for merging my PR, so do you have any news about the new release?
Thanks

@designatednerd
Copy link
Contributor

Shooting for today, have to do some doc updates and testing first

@designatednerd
Copy link
Contributor

This has shipped with 0.24.0!

@josueruiz7
Copy link
Contributor Author

Thanks @designatednerd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior uploading
Projects
None yet
Development

No branches or pull requests

2 participants