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.
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:
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)
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)