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

Impossible to interrupt a long-running media item upload #30

Closed
ylexus opened this issue Apr 25, 2020 · 3 comments
Closed

Impossible to interrupt a long-running media item upload #30

ylexus opened this issue Apr 25, 2020 · 3 comments
Assignees

Comments

@ylexus
Copy link

ylexus commented Apr 25, 2020

PhotosLibraryClient.uploadMediaItem() is blocking uninterruptibly until the upload is complete. In a UI app it means the user is unable to cancel the upload process without killing the app.

Screenshot 2020-04-25 at 23 38 50

Related to ylexus/jiotty-photos-uploader#23

@ylexus
Copy link
Author

ylexus commented May 23, 2021

Any chance this can be improved?

@jfschmakeit
Copy link
Collaborator

We are currently working on some major improvements to the upload flow in the client library - in particular around retries and error handling. This sounds like something that should be considered as well.

You can also configure a timeout for upload calls that cancels any in-progress requests.

(Ideally, calling .cancel(..) on the ApiFuture returned by making a call through the PhotosLibraryClient#uploadMediaItemCallable() should interrupt and cancel the upload. This is something we are looking at improving.)

@jfschmakeit jfschmakeit self-assigned this May 24, 2021
@jfschmakeit
Copy link
Collaborator

The behaviour around this has been improved in the latest release (1.7.0): https://github.com/google/java-photoslibrary/releases/tag/v1.7.0

You should now be able to cancel (and interrupt) long running media uploads. Please file a new issue if you are having issues with this behaviour after upgrading to the latest version.

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

No branches or pull requests

2 participants