Post

Replies

Boosts

Views

Activity

MessageChannel onmessage doesn't respond as app is backgrounded in iOS 14
MessageChannel does not respond (via onmessage) if a message is posted to it just as your app is leaving the foreground on iOS 14. In iOS 13, it used to respond in this case. We noticed we were affected by this issue on iPadOS 14: https://github.com/kriskowal/q/issues/849 (my comment is near the end: mtamburro) Context: We have an app with a WKWebView that uses the q library above, and observed that the library no longer no longer resolved promises after switching from our app to another app. What’s going on: This 3rd party promise library works by posting a message on port 1, and listening to that message on port 2. This works fine until a message is posted just as you switch from our app to another app. When this happens, onmessage does not respond (and then messes up state in the 3rd party library). More specifically, in JavaScript: var channel = new MessageChannel(); channel.port2 posts a message and channel.port1.onmessage responds (except for when the app is leaving the foreground) On iOS 13 onmessage actually responds as the app is leaving the foreground.
1
0
883
Aug ’20