TryQuiet / quiet

A private, p2p alternative to Slack and Discord built on Tor & IPFS
https://www.tryquiet.org
GNU General Public License v3.0
1.94k stars 85 forks source link

Messages not sent/received for several minutes after switching networks #1634

Open holmesworcester opened 1 year ago

holmesworcester commented 1 year ago

Steps to reproduce:

  1. Connect to wifi network
  2. Run Quiet, send a message, confirm it was received quickly
  3. Switch wifi networks (or to mobile data)
  4. Send another message immediately

Expected: it is always received immediately or after a short delay (a few seconds for Tor to connect) Actual: it is received after several minutes (6 in one test, ~20 in another test)

Why is this taking so long and what can we do about it?

In a test on desktop, the logs were silent when I switched networks: no apparent problems but also no sign that it was aware of a problem. When messages were received, I looked back in the logs and there some libp2p PEER_DISCONNECTED events that set in motion new connections. I think this means libp2p + websockets + Tor takes a lot of time to learn it was disconnected, but we should confirm this.

holmesworcester commented 1 year ago

I'm putting this in "Next Sprint" because leaving it unfixed will cause apparent instability and could create issues in the future.