davidgfnet / whatsapp-purple

WhatsApp protocol implementation for libpurple (pidgin)
855 stars 211 forks source link

Disconnect every 6-7 minutes with Tag: stream:error #401

Open semitom opened 8 years ago

semitom commented 8 years ago

version: v0.9.0 pidgin version: Pidgin 2.10.11-16.fc22 (libpurple 2.10.11)

About every 6 or 7 minutes I get disconnected from whatsapp. I built the package with make DEBUG and disconnects happen after the following message:

Tag: stream:error
Data:  ...
 Tag: ack
 at[id]=564BE89EB34399E4479294FA510062
 Data:  ...

After re-connection it retrieves all recent group chat messages again.

simgekim commented 8 years ago

same here. devel version.

ariasrodolfo commented 8 years ago

After re-connection it retrieves\ all recent group chat messages again**. same problem. "ProductName", "Whatsapp for Purple" "ProductVersion", "0.9.0" Pidgin 2.10.10-3.fc20 (libpurple 2.10.10)

saviola777 commented 8 years ago

Same here, disconnect every 6 (+/- 5 seconds) minutes, then a replay of old group chat messages (from about the time it started happening, a couple of days ago) mixed with newer messages (seemingly random order). My own messages are sent correctly, receiving of non-group messages works but is sometimes delayed.

Tested with version 0.9.0 and the most recent git master, resource Android-2.31.151-443.

Imhotep-2700bc commented 8 years ago

Same effect with my installation. It appeared on Tu. 22nd of March. Pidgin 2.10.12 (libpurple 2.10.12), whatsapp for purple 0.9.0 resource Android-2.31.151-443

Imhotep-2700bc commented 8 years ago

Question @semitom I tried "make debug" but got only a message "do nothing". Can you give me a hint how to build a debug version?

ghost commented 8 years ago

same problem here. whatsapp-purple 0.9.0 resource Android-2.31.151-443. Group messages create disconnects every 10 seconds and old and new messages get repeated.

semitom commented 8 years ago

@Imhotep-2700bc It really is as simple as cloning the repo and instead of building with make as documented in the readme, you build with make debug. If you already build it before, you may need to do a make clean to remove the old build files.

Imhotep-2700bc commented 8 years ago

@semitom Thanks for your hint, it works after cleaning the build. Some things are quite simple, I should have thought on this myself.

Now I simply started pidgin from bash shell and I'm able to redirect the debug output into a file. Do you know it there is any debug parameter or predefined output file?

semitom commented 8 years ago

@Imhotep-2700bc Unfortunately I have no knowledge about other possible debugging options

hoehermann commented 8 years ago

I too am affected by this bug. Development build from git revision a802c9a . I am using S40-2.13.30-443 for the client version string.

magnific0 commented 8 years ago

Same problem. BitlBee-LIBPURPLE 3.4.2, whatsapp-purple (latest master, x64 default build) with Android-2.12.440-443.

whatsIGit commented 8 years ago

Same problem with latest master on x64 linux (also same debug output with stream:error etc.). BUT: I had two groups popping up with old messages after the reconnect. One of them eventually stopped to produce the same old messages. After I left the other group (that went on popping up with old messages in random order) the server stopped disconnecting every 5-6 minutes!

hoehermann commented 8 years ago

A keen observation. I too experience old messages being received over and over again. I did not suspect a correlation at first. It could be that we fail to send acknowledgement messages. It could be that we actively request resends. Either behaviour could lead to a server side forced disconnect.

s09bQ5 commented 8 years ago

The order of the messages appears to be messed up because we ask each sender to reencrypt the messages, which updates to timestamp. The sender also does not process our requests in order.

We request reencryption because of these errors:

with varying numbers XXXX.

jEsuSdA commented 8 years ago

I can confirm that. I Have the same problem.

davidgfnet commented 8 years ago

You might want to try the devel branch. In a recent commit I started making use of the "count" field to try to limit the amount of resends we do, so hopefully after 3 or 4 re-sends it will stop somehow.

Imhotep-2700bc commented 8 years ago

¡Hola! I run the devel branch. The repetition of the messages within one session stops after tree times. But the server disconnects the session after a while. After the reconnection all the old messages are sent again.

andreas-42 commented 8 years ago

With devel version, I get duplicated group messages as well (I get disconnected and reconnected every couple of minutes, with old messages repeated), for about half an hour, then it stops. At the moment when the second copy of the message arrives, I get an "Axolotl exception (parseGroupWhisperMessage): DuplicateMessageException Received message with old counter" in the logs. However, the resending then continues for a while as described above - without further exceptions, but lots of stream:error messages as described by others above.

ghost commented 8 years ago

I've been running the devel branch for about 45mins, still keep on getting disconnected every 6-7 minutes and old messages repeated.

s09bQ5 commented 8 years ago

As you can see in the initial comment of this issue, the server sends an id (564BE... above) which is the id of the first message received from the server after having connected. I guess the server is still waiting for us to acknowledge this message. In my case the first disconnect was caused by a group message that I received while I was online, so this problem is not restricted to offline messages.

davidgfnet commented 8 years ago

OK got it, can you please share a full log so I can get a better look at it?

andreas-42 commented 8 years ago

I just sent you a log by e-mail.

whatsIGit commented 8 years ago

Update: For a friends account the method described below did not work. Moreover, it seems that after a couple of group messages the whatsApp server stops delivering further messages of that group, as if it is waiting for a confirmation from the client. In this state my friend could not receive messages from me, though she could send messages to me.

Meanwhile I've found a workaround that makes the recurring group messages stop: I quit pidgin. Then I remove the WhatsApp-Account from .purple/accounts.xml and all WhatsApp-contacts from .purple/blist.xml and start pidgin again. After pidgin has connected to one of my other accounts I stop it again, restore the previous state of accounts.xml and blist.xml, and finally start pidgin. I have no idea why this works. I couldn't find any other config file that has changed in a way that would explain, why the behavior changed. But it seems to work.

saviola777 commented 8 years ago

@whatsIGit

The workaround did not work for me either (but I only have the whatsapp account on pidgin, so I could not connect it to any other accont), and I have observed the same behavior as your friend (but that was before the attempted workaround): eventually I stopped receiving messages for the only group chat I'm in. Leaving and re-joining the group fixed that (well, it went back to 6 minute disconnect + spamming of old and new message in random order).

ghost commented 8 years ago

I also use https://github.com/agamez/yappari whatsapp client with Nokia N900. This client is running ok, so maybe the code can be compared? Or maybe not?!.