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

Keep phone awake while uploading #1725

Closed
EmilEriksen opened this issue Jul 11, 2019 · 5 comments
Closed

Keep phone awake while uploading #1725

EmilEriksen opened this issue Jul 11, 2019 · 5 comments
Labels

Comments

@EmilEriksen
Copy link

Many of our users upload fairly large files on mobile (a few GB sometimes) which means that it takes a while and often long enough for their phone to sleep. When this happens (at least on iOS) internet connectivity is cut and uploading is stalled. Therefore it would be nice to be able to keep the phone awake while uploading.

As far as I can tell there is a web API in the works that can be used to achieve this but it's still in the draft stage. It's possible that it's not really achievable at this point in time but I wanted to post the idea anyway since I believe it would be extremely useful for many of us with mobile users that upload large files.

@arturi
Copy link
Contributor

arturi commented Jul 18, 2019

Hi! This is actually one of the reasons https://tus.io/ was created — resumable uploads mean that when the upload is stalled, you can retry it and it resumes from where it left off, instead of starting from the beginning. Uppy supports tus: https://uppy.io/docs/tus/.

As for the web API, I’m interested to learn more or if someone creates an Uppy plugin that keeps the browser awake while an upload is in progress. So please post here if you find out more or try and create a plugin: https://uppy.io/docs/writing-plugins/ :)

@arturi arturi removed the Triage label Jul 18, 2019
@arturi
Copy link
Contributor

arturi commented Jul 29, 2019

Thanks for the idea again, I think we’ll close this for now, if someone comes up with a solution when the API is ready, please let us know!

@arturi arturi closed this as completed Jul 29, 2019
@EmilEriksen
Copy link
Author

Hi! Sorry for the late reply - I've been on holiday. Resumable uploads are great but uploading large files could take several minutes (or even hours) and it's not ideal that the user has to constantly tend to her/his phone in order to wake it from sleep so that the upload can continue. I do think that it's probably reasonable to close this issue for now though but here are some links to resources for future reference:
Google article about Wake Lock API
W3C Wake Lock API draft
It might also be possible to do something with the Background Sync or Background Fetch APIs (not keeping the phone awake but instead uploading in the background). Background Sync is actually starting to see some support.

@florian-milky
Copy link

Hi!
This would be a really nice feature. I have the same use case

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Jun 15, 2020

I think a custom plugin based on WakeLock would be really interesting to see … it could acquire a lock when the upload event is emitted, and release it when the complete event is emitted. It should then work for any combination of uploader plugins (XHR, Tus, S3, Transloadit, etc).

e; Also adding it to our own backlog for when it's more widely supported and when we have the time.
And thanks @EmilEriksen for bringing this to our attention!

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

No branches or pull requests

4 participants