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

check for server connection #39

Closed
one-dash opened this Issue Mar 4, 2011 · 18 comments

Comments

Projects
None yet
8 participants
@one-dash

one-dash commented Mar 4, 2011

Just got into situation when yaxim looked like it was connected, but actually it seemed not to be. Yaxim resource was not listed on my PC. After switching on WiFi the client successfully detected new connection and reconnected back.

I'm sure if it is reproducible. Maybe there are some forms of ping-pong functionality in XMPP protocol like in IRC?

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Mar 26, 2011

Collaborator

The socket keep-alive code already in place seems not to work properly. I have this issue as well, especially when switching from WiFi to mobile. I see two options: either listen for connection change events and force a reconnect, or implement some application layer pinging like XEP-0199 or XEP-0198. Probably I'll go with the former.

Collaborator

ge0rg commented Mar 26, 2011

The socket keep-alive code already in place seems not to work properly. I have this issue as well, especially when switching from WiFi to mobile. I see two options: either listen for connection change events and force a reconnect, or implement some application layer pinging like XEP-0199 or XEP-0198. Probably I'll go with the former.

ge0rg added a commit to ge0rg/yaxim that referenced this issue Sep 18, 2011

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Sep 18, 2011

Collaborator

Code to disconnect on a network connectivity change is in place as of 0c8ccda, please test this APK.

Collaborator

ge0rg commented Sep 18, 2011

Code to disconnect on a network connectivity change is in place as of 0c8ccda, please test this APK.

@ge0rg ge0rg closed this Sep 18, 2011

@one-dash

This comment has been minimized.

Show comment
Hide comment
@one-dash

one-dash Sep 20, 2011

The problem is still here :-(

one-dash commented Sep 20, 2011

The problem is still here :-(

@ge0rg ge0rg reopened this Sep 21, 2011

@xylo

This comment has been minimized.

Show comment
Hide comment
@xylo

xylo Oct 2, 2011

It seems that this change also had a negative effect. Since version 0.8.1 I cannot shut off yaxim anymore. I tried to close the app via quit from the menu several time. I also disabled "permanent connection" in the settings. But yaxim always reconnects after I while, probably when the network connectivity changes.

xylo commented Oct 2, 2011

It seems that this change also had a negative effect. Since version 0.8.1 I cannot shut off yaxim anymore. I tried to close the app via quit from the menu several time. I also disabled "permanent connection" in the settings. But yaxim always reconnects after I while, probably when the network connectivity changes.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Oct 2, 2011

Collaborator

Indeed. this problem was introduced with 0.8.1 and fixed in 0.8.2. Please upgrade :)

Collaborator

ge0rg commented Oct 2, 2011

Indeed. this problem was introduced with 0.8.1 and fixed in 0.8.2. Please upgrade :)

@xylo

This comment has been minimized.

Show comment
Hide comment
@xylo

xylo Oct 3, 2011

Thanks for the hint. I will upgrade to this version when it's available in f-droid.

xylo commented Oct 3, 2011

Thanks for the hint. I will upgrade to this version when it's available in f-droid.

@tuxmobil

This comment has been minimized.

Show comment
Hide comment
@tuxmobil

tuxmobil Nov 11, 2011

Contributor

I made a few observations regarding the original issue during some more intensive yaxim use recently.

  1. Sometimes, yaxim appears to be connected, but actually the SSL connection is stalled. Once yaxim is triggered to use the connection, the system throws an exception which causes yaxim to reconnect.
  2. A little research for that exception suggests that this is possibly a bug in Gingerbread which may be circumvented by using android.net.http.AndroidHttpClient instead, but that's my impression only from searching the exception on the net and in the android issue tracker. (http://code.google.com/p/android/issues/detail?id=8625)
  3. If the user sends a message when the underlying ssl connection is stalled, this serves as a trigger to the system to throw that exception and have yaxim reconnect quickly, but the message to be sent itself is not sent after reconnecting although being displayed as sent in the chat window. Except the yaxim logo being grey for a very short time during reconnect, there's no indication to the user about that hiccup and lost message.
Contributor

tuxmobil commented Nov 11, 2011

I made a few observations regarding the original issue during some more intensive yaxim use recently.

  1. Sometimes, yaxim appears to be connected, but actually the SSL connection is stalled. Once yaxim is triggered to use the connection, the system throws an exception which causes yaxim to reconnect.
  2. A little research for that exception suggests that this is possibly a bug in Gingerbread which may be circumvented by using android.net.http.AndroidHttpClient instead, but that's my impression only from searching the exception on the net and in the android issue tracker. (http://code.google.com/p/android/issues/detail?id=8625)
  3. If the user sends a message when the underlying ssl connection is stalled, this serves as a trigger to the system to throw that exception and have yaxim reconnect quickly, but the message to be sent itself is not sent after reconnecting although being displayed as sent in the chat window. Except the yaxim logo being grey for a very short time during reconnect, there's no indication to the user about that hiccup and lost message.
@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jan 5, 2012

Collaborator
  1. SMACK is configured to send a ping/pong every five minutes, but I suppose this is not working properly in sleep mode. I will look if it is possible to get around that. On a related note, I need to rework the reconnect code as well, because it waits for a much longer time when the phone is sleeping.
  2. It is possible that the bug is related, however the solution is not applicable because yaxim is not using HTTP.
  3. Unfortunately, this problem will persist until XEP-0198 is implemented both on the servers and in the client.
Collaborator

ge0rg commented Jan 5, 2012

  1. SMACK is configured to send a ping/pong every five minutes, but I suppose this is not working properly in sleep mode. I will look if it is possible to get around that. On a related note, I need to rework the reconnect code as well, because it waits for a much longer time when the phone is sleeping.
  2. It is possible that the bug is related, however the solution is not applicable because yaxim is not using HTTP.
  3. Unfortunately, this problem will persist until XEP-0198 is implemented both on the servers and in the client.
@jan-kiszka

This comment has been minimized.

Show comment
Hide comment
@jan-kiszka

jan-kiszka Apr 22, 2012

Contributor

FWIW, I had my development version of yaxim in this state this morning as well. The server considered the client offline, but yaxim still reported itself and some contact online. This was resolved when I tried to send some message from yaxim. Well, not completely: I lost that message as well.

My phone was connected via WIFI. In contrast to 3G, which even suffers from reconnects when lying idle around, WIFI is was apparently not causing any frequent reconnect. So the phone was offline for multiple hours. Nothing suspicious in the logs.

Contributor

jan-kiszka commented Apr 22, 2012

FWIW, I had my development version of yaxim in this state this morning as well. The server considered the client offline, but yaxim still reported itself and some contact online. This was resolved when I tried to send some message from yaxim. Well, not completely: I lost that message as well.

My phone was connected via WIFI. In contrast to 3G, which even suffers from reconnects when lying idle around, WIFI is was apparently not causing any frequent reconnect. So the phone was offline for multiple hours. Nothing suspicious in the logs.

@tuxmobil

This comment has been minimized.

Show comment
Hide comment
@tuxmobil

tuxmobil Apr 22, 2012

Contributor

I have this behaviour as well frequently, also on wifi. But I assume this happens on 3G as well.

Jan Kiszka reply@reply.github.com schrieb:

FWIW, I had my development version of yaxim in this state this morning
as well. The server considered the client offline, but yaxim still
reported itself and some contact online. This was resolved when I tried
to send some message from yaxim. Well, not completely: I lost that
message as well.

My phone was connected via WIFI. In contrast to 3G, which even suffers
from reconnects when lying idle around, WIFI is was apparently not
causing any frequent reconnect. So the phone was offline for multiple
hours. Nothing suspicious in the logs.


Reply to this email directly or view it on GitHub:
#39 (comment)

Contributor

tuxmobil commented Apr 22, 2012

I have this behaviour as well frequently, also on wifi. But I assume this happens on 3G as well.

Jan Kiszka reply@reply.github.com schrieb:

FWIW, I had my development version of yaxim in this state this morning
as well. The server considered the client offline, but yaxim still
reported itself and some contact online. This was resolved when I tried
to send some message from yaxim. Well, not completely: I lost that
message as well.

My phone was connected via WIFI. In contrast to 3G, which even suffers
from reconnects when lying idle around, WIFI is was apparently not
causing any frequent reconnect. So the phone was offline for multiple
hours. Nothing suspicious in the logs.


Reply to this email directly or view it on GitHub:
#39 (comment)

@doits

This comment has been minimized.

Show comment
Hide comment
@doits

doits May 26, 2012

just happened to me, too (after using yaxim 0.8.4 for 3+ hours). It said it was connected, but sending messages from another account to yaxim did not work. I disconnected and connected yaxim again, and then it worked. I'll see if this happens again.

Please have a look at this, since this is the worst that can happen for on im-app: being disconnected, not knowing it.

Now using the version from 2012-05-13.

doits commented May 26, 2012

just happened to me, too (after using yaxim 0.8.4 for 3+ hours). It said it was connected, but sending messages from another account to yaxim did not work. I disconnected and connected yaxim again, and then it worked. I'll see if this happens again.

Please have a look at this, since this is the worst that can happen for on im-app: being disconnected, not knowing it.

Now using the version from 2012-05-13.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jan 19, 2013

Collaborator

Is the problem still appearing? To provide a solution, I need a debug logcat from the device from the time where it is not connected but believes to be. Unfortunately, I have not been able to produce one myself. Until then, I have not enough hints on what is going wrong.

Collaborator

ge0rg commented Jan 19, 2013

Is the problem still appearing? To provide a solution, I need a debug logcat from the device from the time where it is not connected but believes to be. Unfortunately, I have not been able to produce one myself. Until then, I have not enough hints on what is going wrong.

@maranda

This comment has been minimized.

Show comment
Hide comment
@maranda

maranda Jan 3, 2014

I noticed this behaviour as well (Samsung Galaxy SIII on Android 4.3), I think it could be also related to radio powerstates. Guessing, possibly it's either not handling sleep or power saving modes correctly.

(As a side note testing the MUC apk)

maranda commented Jan 3, 2014

I noticed this behaviour as well (Samsung Galaxy SIII on Android 4.3), I think it could be also related to radio powerstates. Guessing, possibly it's either not handling sleep or power saving modes correctly.

(As a side note testing the MUC apk)

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Jan 3, 2014

Collaborator

Please provide a logcat, as written above. Also, please test the latest non-MUC APK, as there was a significant rewrite of the backend code.

Collaborator

ge0rg commented Jan 3, 2014

Please provide a logcat, as written above. Also, please test the latest non-MUC APK, as there was a significant rewrite of the backend code.

@maranda

This comment has been minimized.

Show comment
Hide comment
@maranda

maranda Jan 3, 2014

I'll try to but I'd need to setup DDMS and start profiling, and tomorrow is the first manifesto day so I probably won't have time till after the 5th.

maranda commented Jan 3, 2014

I'll try to but I'd need to setup DDMS and start profiling, and tomorrow is the first manifesto day so I probably won't have time till after the 5th.

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Feb 17, 2014

Collaborator

Please retry with 0.8.7 (or even better this APK) and update here with your findings.

Collaborator

ge0rg commented Feb 17, 2014

Please retry with 0.8.7 (or even better this APK) and update here with your findings.

@devurandom

This comment has been minimized.

Show comment
Hide comment
@devurandom

devurandom commented Feb 23, 2014

Related to #111?

@ge0rg

This comment has been minimized.

Show comment
Hide comment
@ge0rg

ge0rg Feb 24, 2014

Collaborator

This is kind of related to #111 - this issue is based on ancient code, there was a significant rework in 0.8.7, and the issues in 0.8.7 should be discussed in #111. I will close this issue now, please follow up in #111.

Collaborator

ge0rg commented Feb 24, 2014

This is kind of related to #111 - this issue is based on ancient code, there was a significant rework in 0.8.7, and the issues in 0.8.7 should be discussed in #111. I will close this issue now, please follow up in #111.

@ge0rg ge0rg closed this Feb 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment