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

Ricochet does not show online contacts #295

Closed
taoeffect opened this issue Nov 1, 2015 · 5 comments
Closed

Ricochet does not show online contacts #295

taoeffect opened this issue Nov 1, 2015 · 5 comments

Comments

@taoeffect
Copy link

The other open issues have very technical titles, so I'm sorry if this is a dup of something.

I've noticed that oftentimes Ricochet will not show an online contact when I know they are online. The only way to fix it is to quit the app and restart. This can be annoying since it means losing the contexts of all the conversations you were having. And of course it's an annoying issue in its own right.

@mkroman
Copy link

mkroman commented Nov 3, 2015

Could you provide a log from tor and see if the problem is connecting to the other contacts? You can see the log in Preferences -> Tor.

@taoeffect
Copy link
Author

Thanks, I'll try that next time I catch it happening.

@gabedwrds
Copy link
Contributor

This sounds like the problem I've been investigating for the past while. You should be able to reproduce pretty easily by adding a contact and then having that contact go offline. Normally the Tor log would be full of "Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later)" at least every 15 minutes, but recent builds (including the 1.1.1 release) will only print it once per contact.

It looks like the internal connection between Ricochet and Tor (for a given contact) gets into a failed state that doesn't get cleared like it's supposed to be. Once a contact is in that state, further outgoing connections to that contact will fail unless they try to connect from their end.

My bandaid fix is to add a close() at the top of the TorSocket::onFailed() method so that all that internal state gets cleared out after a failed connection. No idea if that's a viable solution, but it seems to work at least. I'm wondering if there's a better way to clear that error state, but I haven't looked far enough yet - note that resetting the connection to the contact doesn't do it, it's the internal connection to the proxy (read: Tor) that needs to be reset.

Annoyingly I have no idea where this started. The 1.1.0 release is not affected, but if I build the 1.1.0 source myself with Qt 5.4.1 and Tor 0.2.6.7 (both same as 1.1.0), it is affected. Maybe a difference between my Qt build and the one used to build the 1.1.0 release?

@taoeffect
Copy link
Author

Could you provide a log from tor and see if the problem is connecting to the other contacts? You can see the log in Preferences -> Tor.

OK, so right now here's the situation:

  • I opened my laptop from sleep. Been doing some work for a few hours.
  • Friend of mine has theirs open also, and says they can't see me online.
  • I can't see them online either.

The log contains little useful info:

Nov 05 09:10:01.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 09:10:01.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 10:10:32.000 [notice] Your system clock just jumped 3594 seconds forward; assuming established circuits no longer work.
Nov 05 10:11:01.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 10:11:01.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 10:16:22.000 [notice] Your system clock just jumped 284 seconds forward; assuming established circuits no longer work.
Nov 05 10:16:24.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 10:16:24.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 12:07:19.000 [notice] Your system clock just jumped 3594 seconds forward; assuming established circuits no longer work.
Nov 05 12:07:49.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 12:07:49.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 12:34:21.000 [notice] Your system clock just jumped 1556 seconds forward; assuming established circuits no longer work.
Nov 05 12:34:51.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 12:34:51.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 14:08:32.000 [notice] Heartbeat: Tor's uptime is 9:09 hours, with 7 circuits open. I've sent 1.78 MB and received 7.10 MB.

There's only one contact shown online in my list, and it's not my friend who I know is online right now.

gabedwrds added a commit to gabedwrds/ricochet that referenced this issue Dec 23, 2015
On recent builds, Ricochet was failing to reconnect to contacts after a first failed attempt, because the internal connection to the SOCKS proxy was stuck in a failed state. Fix this by closing the TorSocket after a failure, making Qt reset the internal SOCKS connection.

Fixes ricochet-im#295
gabedwrds added a commit to gabedwrds/ricochet that referenced this issue Dec 23, 2015
On recent builds, Ricochet was failing to reconnect to contacts after a first failed attempt, because the connection to the SOCKS proxy was stuck in a failed state. Fix this by closing the TorSocket after a failure, making Qt reset the internal SOCKS connection.

Fixes ricochet-im#295
gabedwrds added a commit to gabedwrds/ricochet that referenced this issue Dec 23, 2015
On recent builds, Ricochet was failing to reconnect to contacts after a first failed attempt, because the connection to the SOCKS proxy was stuck in a failed state. Fix this by closing the TorSocket after a failure, making Qt reset the internal SOCKS connection.

Fixes ricochet-im#295
@rburchell
Copy link
Contributor

Potential Qt-side fix for this is available at: https://codereview.qt-project.org/#/c/144689/ (but the merged change is fine)

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

No branches or pull requests

4 participants