redsolution / xabber-android

Open-source XMPP client for Android
http://xabber.com
Other
1.82k stars 815 forks source link

OTR leads to deadlock (no sending possible) #256

Open BlueMax opened 11 years ago

BlueMax commented 11 years ago

When using OTR and the connection brakes for whatever reason (eg. connection issues or one side disabled it) it leads to a denial of service/deadlock situation (no message can be sent). Sometimes it says:"OTR encrypted session has been terminated. You should do that, too!" or "Messages has not been sent!". To solve this situation both clients have to disconnect/restart the client or disable OTR that is highly confusing especially non-technical people. It would be great if Xabber could simply reestablish OTR automatically in case of an error instead of denying/blocking the service so the communication channel stays up.

I've experienced it multiple times that the chat partners couldn't answer since they didn't know what to do in such a situation and the connection was lost for the day.

Xabber has such a nice OTR implementation but its nearly useless due to the bug above. I hope you can fix this.

eself commented 10 years ago

I think BlueMax is right, these situations would better be handled in an automated way. I have encountered the following behavior with OTR (Xabber Development Version 0.9.30b):

  1. Party A tries to send a message to party B. For some reason (party B just went offline, for example) the delivery is not successful - the icon shows it, and Xabber reports the message could not be delivered or is unreadable (!). Party B will sometimes see an error report on their side, although not the original message from party A. So far so good.
  2. Xabber doesn't seem to try to resolve the issue on its own, which I believe should be the preferred approach.
  3. Now comes the really weird part: If party A sends another message, ignoring the previous error, Xabber makes that new message look as delivered, although party B will not receive anything - neither the message, nor an error report.
  4. Restarting the OTR encryption resolves the issue.

Currently, I am advising my counterparts to go "Menu->More->OTR encryption->Restart encryption" any time they see an error, and warning them that if they fail to do that, some messages may be lost without warning.