Bug 301786 - AccountsModel does not list Salut contacts on load
Summary: AccountsModel does not list Salut contacts on load
Status: RESOLVED UPSTREAM
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: common-internals (show other bugs)
Version: git-latest
Platform: unspecified Linux
: NOR normal
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 22:14 UTC by Martin Klapetek
Modified: 2012-11-30 17:55 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
check for Contact::FeatureRosterGroups on ConnectionManager (927 bytes, patch)
2012-11-30 15:41 UTC, Sander van Grieken
Details
also check for Contact::FeatureRosterGroups on ConnectionManager (972 bytes, patch)
2012-11-30 17:24 UTC, Sander van Grieken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klapetek 2012-06-12 22:14:20 UTC
Reminder for David to fix it.
Comment 1 Vadim A. Misbakh-Soloviov (mva) 2012-11-19 05:28:26 UTC
Hi!
Is it related to the thing, I described in IRC 28th September.

2012-09-28 20:38:45     <mva>   i've folowing problem with ktp:
2012-09-28 20:41:24     <mva>   i've few machines on wireless network. ANd when some machine comes online in link-local xmpp (via salut), all already connected can see user in contact-lists, but this user can't see anybody. 
I've checked with dbus-monitor and it looks like all works fine on telepathy side, and eve on salut. And all users shows fine in dbus, but doesn't appears in ktp-contact list untill they relogin...
2012-09-28 20:41:29     <mva>   any ideas?
2012-09-28 20:41:57     <mva>   dbus-monitor --session log part, if any: http://ompldr.org/vZm5tZQ/paste.txt
Comment 2 David Edmundson 2012-11-19 05:43:19 UTC
Thanks.

Could you describe what's happening whilst you were taking that log (sorry, I know it was a long time ago).

There's two users on Local XMPP Lina and you?

TelepathyQt has a folder called "Examples" in there is an example called "roster".  This will be in your build dir, but not installed.

If you could run this and say if the contacts appear, that would be really useful. 
If they do, then we know it's in our models, if not the problem probably lies inside TpQt (or lower)
Comment 3 Vadim A. Misbakh-Soloviov (mva) 2012-11-19 09:46:04 UTC
1) can't remember right actions order, but it is 100% that roster on "note" was empty when Lina's presence was in dbus, and vice versa: empty roster on Lina's laptop when she came online and _received_ presence from "mva@note" in dbus.
  
Anyway, here is new full (not cutted) log:
http://ompldr.org/vZ2Q0Yg/paste.txt
It starts when I'm offline, then I change status to Available.

As you can see, it _is_ presences from Lina in dbus, but she is not in the roster. 

(And, just for test, I just restarted network connection on her laptop (which caused ktp-salut reconnection) and now I see her contact in my roster, while she can't see mine. So it still works in both sides).

2) yes. it is two users on the network. Both uses wireless connections, both use ktp.

3) http://ompldr.org/vZ2Q0bA/ktp_paste.txt (look at two comments at the end)
But roster in ./roster's GUI windows is empty anyway.
Comment 4 David Edmundson 2012-11-20 08:07:26 UTC
It's a bug in TpQt

The ContactManager never enters state ready. the ContactManager always remains in state -1, which isn't even a valid enum value for the ContactManager state.

This is because when groupsroster fails, it never calls setStateSuccess

The bug appears to be in:
void ContactManager::Roster::gotContactListContacts(QDBusPendingCallWatcher *watcher)

When running with a bit of debug:

846    if (introspectPendingOp) {
               is true

848        if (!groupsSetSuccess) {
                is false   (as in groupsSetSuccess==true)

(line numbers may be wrong due to added qDebug statements)
So nothing will ever call setStateSuccess, it just stays in limbo. 

FWIW: groupsReintrospectionRequired is false.

I'm not sure which path it's meant to go down. I "think" if you remove the "if (!groupsSetSuccess)" and always execute this code, everything will work. However I don't fully understand this code and don't want to edit it.

(leave this bug open until a new bug is opened on freedesktop.org, and then close this one as upstream)
Comment 5 Sander van Grieken 2012-11-30 15:41:50 UTC
Created attachment 75549 [details]
check for Contact::FeatureRosterGroups on ConnectionManager

I've done some experimenting with local xmpp and also a jabber account to verify behaviour.

It looks like the contact list groups are wrongfully assumed for local-xmpp if the features on the Connection are checked. The requestedFeatures on the connection contains a Connection::FeatureRosterGroups feature, leading to a situation where setStateSuccess() is never called, because in introspectGroups() the missing functionality is caught and short-circuited.

My guess is it should check on the supported features of the ContactManager, not on the requested features of the Connection.

I've created a patch, which makes local-xmpp behave as expected.
Comment 6 David Edmundson 2012-11-30 15:58:17 UTC
That patch itself is wrong, you're now getting the groups if they're available regardless of whether you requested them or not. 

However, you've clearly got the right idea for a fix. Change it to 

if (supported && requested) 


Brilliant, lets try and get this merged into TpQt.
Comment 7 Sander van Grieken 2012-11-30 17:21:15 UTC
bug @ freedesktop.org : https://bugs.freedesktop.org/show_bug.cgi?id=57739
Comment 8 Sander van Grieken 2012-11-30 17:24:35 UTC
Created attachment 75551 [details]
also check for Contact::FeatureRosterGroups on ConnectionManager

You mean like this?
Comment 9 Sander van Grieken 2012-11-30 17:52:42 UTC
I guess you can close this bug now, since it's now on freedesktop.org..

If you know an area that needs some attention, let me know. I'm new to this codebase and I've only looked through the code for a few hours, but I have some time on my hands the next few weeks..
Comment 10 David Edmundson 2012-11-30 17:55:39 UTC
Thanks!

Closed as an upstream issue. Everyone interested please track the freedesktop bug:
https://bugs.freedesktop.org/show_bug.cgi?id=57739