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

Timeouts on iOS devices when users switch to other apps #1298

Open
Cameri opened this Issue Mar 6, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@Cameri

Cameri commented Mar 6, 2015

If you open up a page on Safari, and you switch to another app, all network requests and any code running (including setInterval and setTimeout) are paused until you switch back to Safari.
See http://stackoverflow.com/a/4941098/2393627

When you switch back to Safari after some time, the javascript code executes again, including that of RequireJS. RequireJS then checks the time difference of pending network requests and figures out that it's been a long time and times out. The network requests never really had the "time" (in CPU cycles, that is) to be resolved.
RequireJS does not check if the application has been put to sleep and does not offset the time differences accordingly.

@infacq

This comment has been minimized.

infacq commented Mar 8, 2015

Google chrome also use similar technique. If you switch to other tab, it's seems to halt the loading resources execution. In HTML5, I know there is pageVisibility api to tackle this issue. I'm not sure about iOS safari. Really bug me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment