-
-
Notifications
You must be signed in to change notification settings - Fork 699
App Crashed on manual retrying with: java.lang.IllegalStateException: You have already called startUpload() on this Upload request instance once and you cannot call it multiple times. Check your code.
#672
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
Comments
@PavlosTze having also an automatic test for this, please check your app's lifecycle where you are starting the upload, this exception is thrown when you are starting the same upload twice. What is exactly "Manual retrying"? You should use the retry policy mechanism of the library instead. |
We use the automatic retry policy, but we also have a "Retry" button when the upload fails, which the user can click, and based in your guide I posted above, I save the Isn't it the correct solution? |
That guide is really old and maybe needs a refresh. It's been written before the persistent uploads feature and it covers only a bare minimum simple example. In your case you are attempting to retry an upload which is still in the execution phase and so the exception is correct. You can check the running tasks using the management APIs before attempting to start the upload. |
I just tried again to debug it with the management APIs: Even the I think the problem is that on UploadRequest, the |
Actually it could be safe to completely remove the "started" private property and relative checks and rely on the task list checks which should be sufficient. You are welcome to make a PR. |
Ready. If that's OK, could you please release a new version as we need this feature in our project? |
Released fix in |
Describe the bug
I followed your guide on Advanced topics mentioning:
But I got a crash with a following message:
java.lang.IllegalStateException: You have already called startUpload() on this Upload request instance once and you cannot call it multiple times. Check your code.
To Reproduce
Steps to reproduce the behavior:
startUpload
again on this requestExpected behavior
To retry properly.
OS and Lib versions (please complete the following information):
Request code:
Where have you added the request code?
Debug Log:
Other info:
Project
The text was updated successfully, but these errors were encountered: