Bug 31997 - let contact list channels' AddMembers/RemoveMembers methods fail
Summary: let contact list channels' AddMembers/RemoveMembers methods fail
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: 0.13
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
Depends on: 31998
Blocks: 19902
  Show dependency treegraph
 
Reported: 2010-11-30 05:17 UTC by Simon McVittie
Modified: 2010-12-08 08:51 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.