Project

General

Profile

Bug #244

Messages from other party not received when chat started from Beem

Added by James Blair about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XMPP
Target version:
Start date:
02/16/2010
Due date:
% Done:

80%

Estimated time:
Affected version:
hg
Locale:
Close

Description

When I start a chat from Beem, I don't receive messages from the other party, but if the other party starts a chat, it works fine.

To reproduce:

  1. Start Beem and log in
  2. Click on a contact to start a chat
  3. Send a message (the contact will receive this)
  4. Any response from the contact will not show up

I added some debug messages and re-compiled, and I believe this is what is happening:

When a chat is started with Beem, the participant passed to smack is "", with no resource appended. When the user replies, smack starts a new chat with the participant "/resource". Beem strips the resource when it looks up the existing chat, so it knows not to start a new chat. However, the problem is that smack has created two chats, and Beem has only associated its chat object with smack's first chat object (the one created for the outgoing chat with no resource appended).

If, however, the remote user starts the chat, then only one chat object is created (for the incoming message from "/resource") and everything works.

I added a debugging message to BeemChatManager.ChatListener.chatCreated that shows what's going on:

(click on contact in Beem to start chat)
D/BeemChatManager( 1103): Get chat key =
V/BeemChatManager( 1103): chat created locally org.jivesoftware.smack.Chat@437c5090 participant
I/ActivityManager( 570): Displayed activity com.beem.project.beem/.ui.Chat: 284 ms
(remote user sends a message)
V/BeemChatManager( 1103): chat created non-locally org.jivesoftware.smack.Chat@437f7cd0 participant /resource

I tested this with a locally compiled Beem from revision 673, ejabberd, and pidgin.


Related issues

Related to Bug #243: Unable to receive messages after contact logoutClosed2010-02-15

Associated revisions

Revision 675:764eded78962 (diff)
Added by Da Risk about 9 years ago

Fixes #244 #243

Revision 675:764eded78962 (diff)
Added by Da Risk about 9 years ago

Fixes #244 #243

History

#1 Updated by Frédéric Barthéléry about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Frédéric Barthéléry
I was debugging on this yesterday. It is exactly what is happening.
We should not create the Chat before sending a message to the user. (Note : if we send a message the problem doesn't appear). However I have not figure yet how to deal properly with open chat window. For example :
  • we open the chat activity for contact
  • /res send us a message. We should display it on the open chat activity instead of displaying a notification.

#2 Updated by Frédéric Barthéléry about 9 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r675.

#3 Updated by Jerome M. about 9 years ago

Hello,

It seems like the bug is still present for me... :(

#4 Updated by Nikita Kozlov about 9 years ago

jer mar wrote:

Hello,

It seems like the bug is still present for me... :(

Are you sure that you have the last repository version ?

#5 Updated by Jerome M. about 9 years ago

well, I triple checked that, verified md5sum of built and installed packages... I'm pretty sure now...

#6 Updated by Frédéric Barthéléry about 9 years ago

  • Status changed from Resolved to Feedback
  • Target version set to 0.2
  • % Done changed from 100 to 80

From the r675 changeset, there is normally only one chat created.
The chat activity now create the smack Chat object only when we are sending a message first.
I cannot reproduce your bug anymore. Could you try to get a little more details on this ?

#7 Updated by Jerome M. about 9 years ago

It seems like the problem is the same as described by James regarding the resource when creating the chat. One is created locally when sending the first message from beem, and another one is created when replying from the other client (empathy here) Here is an extract of my logs:

I/ActivityManager( 108): Displayed activity com.beem.project.beem/.ui.Chat: 266 ms (total 266 ms)
D/BeemChatManager( 760): Get chat key = jahrome@server
D/BeemChatManager( 760): Chatorg.jivesoftware.smack.Chat@45f36048 created locally truewith jahrome@server
I/FieldContext( 198): Bundle = Bundle[{imeOptions=1073741828, packageName=com.beem.project.beem, inputType=163905, hint=Type your message, label=, fieldName=, fieldId=2131361809, singleLine=false}]
D/BeemChatManager( 760): Chatorg.jivesoftware.smack.Chat@45f87e60 created locally falsewith jahrome@server/Telepathy.572f9ef8
D/dalvikvm( 542): GC freed 2673 objects / 139120 bytes in 91ms

#8 Updated by Frédéric Barthéléry about 9 years ago

Can you check the jabber log of empathy and see if empathy responds to beem with a message containing the samedi thread element. If not this may be a bug in empathy.

#9 Updated by Jerome M. about 9 years ago

I have troubles understanding what samedi is... could you clarify tis point ?
Empathy does not generate such logs, I tried with pidgin and it is the same issue as it appends a ressource id :

D/BeemChatManager( 949): Chatorg.jivesoftware.smack.Chat@45f9c258 created locally falsewith jahrome@server/24c480416ba8300d08edc50a743c0b4c60f7eb95

Hope this help

#10 Updated by Nikita Kozlov about 9 years ago

jer mar wrote:

I have troubles understanding what samedi is... could you clarify tis point ?
Empathy does not generate such logs, I tried with pidgin and it is the same issue as it appends a ressource id :

D/BeemChatManager( 949): Chatorg.jivesoftware.smack.Chat@45f9c258 created locally falsewith jahrome@server/24c480416ba8300d08edc50a743c0b4c60f7eb95

Hope this help

samedi is the french world for saturday.

#11 Updated by Frédéric Barthéléry about 9 years ago

jer mar wrote:

I have troubles understanding what samedi is... could you clarify tis point ?

Sorry completion error. I was thinking about the same thread. Pidgin haver a console that can display the XMPP message exchanged with the server. Maybe empathy got one too.

#12 Updated by Jerome M. about 9 years ago

here is the jabber log from pidgin:

(15:28:14) jabber: Recv (278): <message xmlns='jabber:client' type='chat' from='test@server/Beem' to='jahrome@server/045539a5bf1a21e3cbd97bd34f4a22d70e71f5d1' id='K2XDV-11'><subject/><body>test message</body><thread>iCehk5</thread><active xmlns='http://jabber.org/protocol/chatstates'/></message>
(15:28:19) jabber: Sending: <message type='chat' id='purpled922a18a' to='test@server/Beem'><composing xmlns='http://jabber.org/protocol/chatstates'/></message>
(15:28:20) jabber: Unable to find caps: nothing known about buddy
(15:28:20) jabber: Sending: <message type='chat' id='purpled922a18b' to='test@server/Beem'><active xmlns='http://jabber.org/protocol/chatstates'/><body>reply message</body></message>
(15:28:20) jabber: Sending: <message type='chat' id='purpled922a18c' to='test@server/Beem'><active xmlns='http://jabber.org/protocol/chatstates'/></message>

#13 Updated by Frédéric Barthéléry about 9 years ago

So this is a little bug in pidgin and empathy, maybe in the libpurble.
According to the rfc3921,

The value of the <thread/> element is generated by the sender and SHOULD be copied back in any replies.

They don't answer with the thread element so smack thinks it is another chat. I will make a little patch for smack to force it to deliver the message to the chat conversation for the same bare jid (without the resource).

#14 Updated by Frédéric Barthéléry about 9 years ago

The bug should normally be fixed by the new asmack library with a custom patch in r696

#15 Updated by Anonymous about 9 years ago

Same problem here. The porblem only started after the last update. Could you please offer the previous version in the Market until this issue is fixed. The previous version was working fine for me.

Thanks.

#16 Updated by Nikita Kozlov about 9 years ago

It's not surprising me since I make a lot of changes in chat's related classes.
I will take a look on it this afternoon.
I hope we will manage to fix this bug before the next release.

#17 Updated by Nikita Kozlov about 9 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Frédéric Barthéléry to Nikita Kozlov

#18 Updated by Frédéric Barthéléry about 9 years ago

You can download the older version of Beem here. You can install it with a file manager for Android or using the android sdk.
You can also try the nigtly build where the bug should be fixed : http://dev.beem-project.com/Beem-debug.apk
Please report any change on this.

#19 Updated by Frédéric Barthéléry about 9 years ago

  • Status changed from Assigned to Resolved
  • Target version changed from 0.2 to 0.1.3

#20 Updated by Frédéric Barthéléry about 9 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF