I suspect that this issue is partly to blame for the poor reliability of chat in Duolicious: https://github.com/xmppjs/xmpp.js/issues/902 I also suspect that the Duolicious chat server's reliability is poor.
In any case, we can probably just add some retries and recreate chat clients when the server comes out of the inactive state.
Changes:
Increase reconnection delay - This prevents clients from DDoSing the server when it goes down then comes back online. Ideally the XMPP library we use (xmpp.js) would support exponential back-off, but it doesn't.
Recreate the xmpp.js client when the app comes out of the background state on mobile.
Show a spinner on the inbox tab when temporarily offline
Use an application-level ping mechanism to determine if the server can be contacted. This should be supported at the transport later seeing as we use websockets. Though some random Stack Exchange post said there's inconsistency between the behavior of different browsers with respect to websocket pings.
I suspect that this issue is partly to blame for the poor reliability of chat in Duolicious: https://github.com/xmppjs/xmpp.js/issues/902 I also suspect that the Duolicious chat server's reliability is poor.
In any case, we can probably just add some retries and recreate chat clients when the server comes out of the inactive state.
Changes:
Increase reconnection delay - This prevents clients from DDoSing the server when it goes down then comes back online. Ideally the XMPP library we use (xmpp.js) would support exponential back-off, but it doesn't.
Recreate the xmpp.js client when the app comes out of the background state on mobile.
Show a spinner on the inbox tab when temporarily offline
Use an application-level ping mechanism to determine if the server can be contacted. This should be supported at the transport later seeing as we use websockets. Though some random Stack Exchange post said there's inconsistency between the behavior of different browsers with respect to websocket pings.