Skip to content
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

Attempt to make chat more reliable #391

Merged
merged 9 commits into from
Sep 1, 2024
Merged

Conversation

duogenesis
Copy link
Member

@duogenesis duogenesis commented Aug 28, 2024

I suspect that this issue is partly to blame for the poor reliability of chat in Duolicious: xmppjs/xmpp.js#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.

@duogenesis duogenesis force-pushed the application-level-keepalives branch 2 times, most recently from 63574ae to f7bf839 Compare August 30, 2024 20:09
@duogenesis duogenesis merged commit 57bbb53 into main Sep 1, 2024
2 checks passed
@duogenesis duogenesis deleted the application-level-keepalives branch September 1, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant