Bug 37729 - tp_cli_dbus_properties_call_get returns identical addresses for different buddies
Summary: tp_cli_dbus_properties_call_get returns identical addresses for different bud...
Status: RESOLVED NOTABUG
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-29 13:06 UTC by Marc Maurer
Modified: 2011-05-31 01:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Gabble logfiles for a collaboration session between 3 people (53.37 KB, application/x-gzip)
2011-05-30 11:12 UTC, Marc Maurer
Details

Description Marc Maurer 2011-05-29 13:06:29 UTC
I'm using tp_cli_dbus_properties_call_get() to retrieve the TpHandle <-> dbus address mapping in a tube MUC:

tp_cli_dbus_properties_call_get(
    chan, -1, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "DBusNames",
    retrieve_buddy_dbus_mappings_cb,
    NULL, NULL, NULL);

But in the retrieve_buddy_dbus_mappings_cb() callback, every TpHandle id maps to the same address:

GHashTable* name_mapping = (GHashTable*)(g_value_get_boxed(out_Value));
gpointer key;
gpointer value;
GHashTableIter iter;
g_hash_table_iter_init(&iter, name_mapping);
while (g_hash_table_iter_next(&iter, &key, &value))
{
    printf("Got room member - handle: %d, address: %s\n", GPOINTER_TO_UINT(key), (const gchar*)(value));
}

This prints things like:

Got room member - handle: 12, address: :2.dXdvZzIwQGphYmJlci5vcmcA
Got room member - handle: 13, address: :2.dXdvZzIxQGphYmJlci5vcmcA

I'd expect every buddy to have a different dbus address.

This is using gabble 0.11.3.
Comment 1 Guillaume Desmottes 2011-05-30 01:31:37 UTC
0.11.3 is pretty old, you should use 0.12.0 which is the latest stable release.

Could you please start Gabble with GABBLE_DEBUG=all WOCKY_DEBUG=all GABBLE_PERSIST=1 GABBLE_LOGFILE=/tmp/gabble.log and attach the log ?
Comment 2 Marc Maurer 2011-05-30 11:12:51 UTC
Created attachment 47333 [details]
Gabble logfiles for a collaboration session between 3 people

I've set up a collaboration session between 3 people: uwog20@jabber.org, uwog21@jabber.org and uwog22@jabber.org , and generated 3 log files.

Their contents is created from the following procedure:

1. Start gabble
2. Start empathy
3. Start abiword to register it's capabilities with Telepathy
4. Let uwog20@jabber.org create a dbus tube MUC and invite uwog21@jabber.org and uwog22@jabber.org
5. uwog21@jabber.org and uwog22@jabber.org accept
6. Close abiword and empathy again

In step 5 things go wrong, as the TpHandle for all people in the room are the same.
Comment 3 Marc Maurer 2011-05-30 11:18:55 UTC
The attached log was created by gabble 0.12.0 as requested btw.
Comment 4 Guillaume Desmottes 2011-05-31 00:50:03 UTC
(In reply to comment #0)
> This prints things like:
> 
> Got room member - handle: 12, address: :2.dXdvZzIwQGphYmJlci5vcmcA
> Got room member - handle: 13, address: :2.dXdvZzIxQGphYmJlci5vcmcA
> 
> I'd expect every buddy to have a different dbus address.

After one hour of logs reading, tests and debugging I'm happy to say that...
there is no bug! :D

I also read those strings as equals at first but they are not:
:2.dXdvZzIwQGphYmJlci5vcmcA
:2.dXdvZzIxQGphYmJlci5vcmcA
          ^

So yeah, things are fine, most confusing strings ever! :)
Comment 5 Simon McVittie 2011-05-31 01:54:32 UTC
(In reply to comment #4)
> (In reply to comment #0)
> > I'd expect every buddy to have a different dbus address.
> 
> I also read those strings as equals at first but they are not:
> :2.dXdvZzIwQGphYmJlci5vcmcA
> :2.dXdvZzIxQGphYmJlci5vcmcA
>           ^

That's because your JIDs only differ by 1 bit, the default nickname is the same as the "user" part of the JID (e.g. uwog22), and the unique names used in the tube are a modified base64 encoding of the nickname to guarantee collision-avoidance (unless the nickname is far too long, in which case a hash is used and collisions are merely very unlikely).

http://telepathy.freedesktop.org/xmpp/tubes.html#sect-id2252072


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.