question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Safari drops ticks for backgrounded tasks iOS 14

See original GitHub issue

We are developing an Cordova based iOS App. Everything works fine on iOS 13, but we experience issues on iOS 14.

Whenever the App is sent to background and retrieved again the app is unresponsive as we use Q.js for our ViewManager.

When debugging this via the Safari Web Inspector I noticed that var def = Q.defer(); def.promise.done(function(value) { alert(value); }); def.resolve("Done") works before but not after sending the app to the background. However native Javascript Promises work as expected new Promise(function(resolve, reject) { resolve("Done"); }).then(function(value) { alert(value) });

When inspecting the def variable using def.promise.inspect() the state is resolved and I can see the value, however none of the functions (resolve, reject, finally) are called, neither in the done, nor in the then function.

Anyone experience similar issues?

Edit: We are using Q#1.5.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kriskowalcommented, Jul 10, 2020

There were reports of Safari dropping timer events ages ago. I don’t know whether they went away, but your description of the problem seems to indicate a regression. Apart from looking for a more reliable primitive for timers as @benjamingr hints at, there is not a lot Q can do, and changing the underlying nextTick implementation requires very time consuming testing.

To wit, you can see some of that rigor over on https://github.com/kriskowal/asap, which I’ve not updated in ages.

It may be worthwhile to file an issue against Safari.

1reaction
msmtamburrocommented, Aug 26, 2020

FYI, I opened FB8533670 with Apple regarding a change in onmessage in WKWebView on iPadOS 14 as the App leaves the foreground. My related Apple Developer Forum post is here, for tracking.

Ended up making a temporary patch to q.js:

  • creating a backup setTimeout right before posting a message
  • clearing that timeout in flush()

When the posted message is missed, the timeout calls flush().

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS Background Task Time Interval - Apple Developer
Hello! We are currently working on our iOS project, and we plan to make a feature that the app could send an HTTP...
Read more >
iOS 15 Released - What's New? (300+ New Features)
(300+ New Features & Changes) + Performance & Battery Life Apple just released the final, official version of iOS 15 & iPadOS 15...
Read more >
Tips and Tricks for New iPhone 13 Owners - MacRumors
Toggle on "Background Image" if you want to pick a custom background for Safari. You can choose from the available Apple-designed backgrounds or ......
Read more >
The Safari Settings You Should Tweak Right Now - WIRED
For iOS users, that means mastering Safari: how to stay safe online, ... original tab open in the background while you work on...
Read more >
35+ Safari tips and tricks for iPhone in iOS 16 - iGeeksBlog
So, you may duplicate any internet picture and erase its background. Besides, paste the cutout, save it, or drop it anywhere on your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found