After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619874 - backlog in chat rooms seems broken
backlog in chat rooms seems broken
Status: RESOLVED NOTGNOME
Product: empathy
Classification: Core
Component: Multi User Chat
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-27 20:16 UTC by Jussi Kukkonen
Modified: 2010-06-04 08:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
short sample of chat log with duplicates (2.94 KB, text/plain)
2010-05-28 08:21 UTC, Jussi Kukkonen
Details

Description Jussi Kukkonen 2010-05-27 20:16:16 UTC
I'm almost certain that there are bugs in backlog generation when I join a chat room.

Just a minute ago I quit Empathy and started it again and joined my favorite XMPP chatrooms: I see a backlog from yesterday evening and not the discussion I was just in five minutes ago, except that inexplicably there is one message from five minutes ago.

Sometimes I see duplicate messages. Sometimes I see practically all of the conversation, but still miss some messages. Example:

> pippin: MxTrail or MxAfterImage ?
> pippin: MxTrail or MxAfterImage ?
> pippin: MxTrail or MxAfterImage ?
> pippin: MxTrail or MxAfterImage ?
> iain: mallum: it boots in 250ms
> pippin: MxTrail or MxAfterImage ?

pippin only asked the question once in reality. 

If I join a chat room, leave and join again, the results can be entirely different each time.

In other words, I can't trust the backlog at all.
Comment 1 Jussi Kukkonen 2010-05-27 20:19:49 UTC
Also, often when I join a room, the backlog doesn't actually contain usernames/aliases, just 

  room@server: hey, look at http://meego.com
  room@server: oh cool

where "room" is he chat room name and "server" is the server address
Comment 2 Guillaume Desmottes 2010-05-28 07:30:57 UTC
(In reply to comment #0)
> pippin only asked the question once in reality. 

Could you check in the logs if the question appears once or 5 times?

(In reply to comment #1)
> Also, often when I join a room, the backlog doesn't actually contain
> usernames/aliases, just 
> 
>   room@server: hey, look at http://meego.com
>   room@server: oh cool
> 
> where "room" is he chat room name and "server" is the server address

Still a XMPP chatroom right? Same question, could you check what's stored in the log please?

See http://live.gnome.org/Empathy/FAQ#Where_does_Empathy_save_files_.28accounts.2C_logs.2C_configuration.29.3F about where the logs are stored.
Comment 3 Jussi Kukkonen 2010-05-28 08:21:05 UTC
Created attachment 162176 [details]
short sample of chat log with duplicates

Yes, this is XMPP.


The logs have multiple entries as well, although I'm not sure if they match any logs that I saw in the UI... It seems the messages that get duplicated in the UI have no "token". Please see attachment.
Comment 4 Jussi Kukkonen 2010-05-28 08:52:31 UTC
(In reply to comment #2)
> > Also, often when I join a room, the backlog doesn't actually contain
> > usernames/aliases, just 
> > 
> >   room@server: hey, look at http://meego.com
> >   room@server: oh cool
> > 
> > where "room" is he chat room name and "server" is the server address
> 
> Still a XMPP chatroom right? Same question, could you check what's stored in
> the log please?

Some leads: I have what look like a working chatroom log files in 
gabble_jabber_user_server/chatrooms/room@server/*.log. Example content:

<message time='20100527T18:04:03' cm_id='0' id='room@server/user' name='user' token='' isuser='false' type='normal'>what a surprise...</message>

(user, room and server names changed to protect the innocent)


Interestingly, I also have this:
gabble_jabber_user_server/room@server/*.log. Example content:

<message time='20100527T18:04:03' cm_id='4' id='room@server' name='room@server' token='' isuser='false' type='normal'>what a surprise...</message>

This line is repeated several times.



So it looks like the chatroom backlog sometimes gets logged like it was a chat with a normal user. I'm starting to believe this same problem shows up in various places:
bug 619866 comment 1: search UI becomes weird
bug 619913: strange notifications as if the chatroom was messaging me
Comment 5 Guillaume Desmottes 2010-05-28 09:40:16 UTC
Thanks for the info. Dropping the current state of my investigation.

The messages is logged twice, one considering it as a chatroom message (which is fine):
gabble_jabber_user_server/chatrooms/room@server/*.log

time='20100527T18:04:03'
cm_id='0'
id='room@server/user'
name='user'

And one considering it as a private message (which is wrong):

gabble_jabber_user_server/room@server/*.log.

time='20100527T18:04:03'
cm_id='4' 
id='room@server'
name='room@server'

Time is the same so that seems to be the same message.

cm_id is got calling: empathy_message_get_id (message)

id is got calling: empathy_contact_get_id (sender)
name is got calling: empathy_contact_get_name (sender)
with server defined as : sender = empathy_message_get_sender (message);

So we have 2 different EmpathyMessage objects for the same TP message. log_store_empathy_add_message() is called twice (one for each EmpathyMessage): one with chatroom=True and one with chatroom=False.
Comment 6 Guillaume Desmottes 2010-06-03 08:01:49 UTC
Are messages duplicated in 2 log files each time you are in this room? If do could you please attach Empathy logs when you receive messages from this room?
Comment 7 Guillaume Desmottes 2010-06-04 08:07:54 UTC
I'm pretty sure this bug was because of https://bugs.freedesktop.org/show_bug.cgi?id=27913
Could you try to reproduce with Gabble 0.9.12 and reopen if needed please?