Bug 31997

Summary: let contact list channels' AddMembers/RemoveMembers methods fail
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: jonny.lamb
Version: 0.13Keywords: patch
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=commitdiff;h=refs/heads/async-contact-list
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 31998    
Bug Blocks: 19902    

Description Simon McVittie 2010-11-30 05:17:14 UTC
In the ContactList channels implemented by TpBaseContactList, any asynchronous errors reported by the concrete subclass are silently ignored (the Conn.I.ContactList/Conn.I.ContactGroups methods would report them, though).

This is a side-effect of using TpGroupMixin, which can't report success/errors asynchronously, combined with having purely asynchronous virtual methods for the concrete subclasses to implement.

To port Haze to TpBaseContactList, RemoveMembers on a Group needs to be able to fail, to prevent removing a contact from the fallback group (_("Buddies")) if it's their only group. In my current work-in-progress branch, tests fail, because removing the contact is silently prevented, but RemoveMembers() "succeeds".

There are two ways we could fix this:

* Override AddMembers, RemoveMembers and RemoveMembersWithReason in the internal ContactList channels; make them succeed/fail asynchronously. This breaks the Gabble tests, which expect these methods to succeed immediately unless there's an obvious problem like a bad handle.

* Add a synchronous "check addition"/"check removal" virtual method which can raise an error synchronously, and call that before calling the async one. This would mean that implementations can fail, but only synchronously.

I think I prefer the first of these approaches, even though it changes observable behaviour in Gabble and requires tests to be relaxed a bit. If any other CMs already use TpBaseContactList, they'll probably need to make similar changes.
Comment 1 Simon McVittie 2010-11-30 05:22:39 UTC
(In reply to comment #0)
> I think I prefer the first of these approaches, even though it changes
> observable behaviour in Gabble and requires tests to be relaxed a bit.

Bug #31998 makes the necessary changes.
Comment 2 Simon McVittie 2010-11-30 10:40:14 UTC
Now with an actual patch (a single commit).
Comment 3 Simon McVittie 2010-12-08 08:51:20 UTC
Fixed in 0.13.8

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.