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

Prevent computer/device from sleeping while uploading #4141

Open
mifi opened this issue Oct 13, 2022 · 2 comments
Open

Prevent computer/device from sleeping while uploading #4141

mifi opened this issue Oct 13, 2022 · 2 comments
Labels

Comments

@mifi
Copy link
Contributor

mifi commented Oct 13, 2022

Problem

While uploading a large file, the computer or phone might go to sleep, we should prevent this

Solution

We could use the WakeLock API but it seems to have limited browser support.

Maybe we can implement a <video> tag with a looping 1-pixel video or so. https://stackoverflow.com/questions/59471449/how-to-prevent-screen-sleep-using-javascript

Need to find out how to detect when the browser activates sleep prevention (logs, enable debug logging, operating system logs?)

We could make an Uppy plugin that uses the WakeLock API by default, but with an optional (configurable) fallback to some hack like video/audio tag or similar

See also #1725

Alternatives

Allow the upload to resume if it’s interrupted by a sleep or similar. However that is a different issue that should also be fixed regardless of the current issue. See #3783

@sylvesteryue
Copy link

Hi, can I try taking this on? I would love to look into this

@arturi
Copy link
Contributor

arturi commented Oct 23, 2022

@sylvesteryue yes please, we'll gladly review / help out on a PR.

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