Bug 29812 - Implement Account.Interface.MinimumPresence draft 2
Summary: Implement Account.Interface.MinimumPresence draft 2
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Will Thompson
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/wj...
Whiteboard: review+
Keywords: patch
Depends on: 29811
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-26 00:24 UTC by Senko Rasic
Modified: 2010-12-21 11:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Senko Rasic 2010-08-26 00:24:17 UTC
Mission control implementation of A.I.MinimumPresence.

The branch implementing this is listed in the url of this bug.
Comment 1 Senko Rasic 2010-08-26 01:58:12 UTC
Drive-by review by Will on IRC:

> Release() should remove before re-choosing a presence

Hm, why? I thought it was a way for clients to change their mind about the
presence they want, not as a shortcut to Release()/Request().

Example:
  1. client sets MinimumPresence to busy
  2. user sets RequestedPresence to offline (presence stays busy)
  3. client changes MinimumPresence to hidden
  4. presence changes to hidden

If it were to remove presence before re-choosing it:
  1. client sets MinimumPresence to busy
  2. user sets RequestedPresence to offline (presence stays busy)
  3. client changes MinimumPresence to hidden, but this first releases it
  4. connection goes down, since presence is offline
  5. now new MinimumPresence request is in effect, connection is brought back up

I can't see any reason why this would be useful. Also, not releasing before updating requested presence seems to me analogous of how RequestedPresence works - you don't go via offline/unset when changing from one (oneline) presence to another.

> it doesn't notice if clients call Request(), then die before calling Relese()

Added (in several patches). Also noticed that my original code set new
minimum presence before removing the presence being removed from the list, oops!

> copyrights are wrong

pushed the patch to correct this
Comment 2 Will Thompson 2010-08-26 02:15:26 UTC
(In reply to comment #1)
> Drive-by review by Will on IRC:
> 
> > Release() should remove before re-choosing a presence
> 
> [...]
> 
> > it doesn't notice if clients call Request(), then die before calling Relese()
> 
> Added (in several patches). Also noticed that my original code set new
> minimum presence before removing the presence being removed from the list,
> oops!

...and the latter is what I meant by my first comment above. Sorry for the lack of clarity. :)
Comment 3 Will Thompson 2010-08-26 06:13:11 UTC
  *
  * Contact: Alberto Mardegan  <alberto.mardegan@nokia.com>

I guess he'd rather not be contacted about a file he's never touched? We could just bin that line.

+    priv = g_new0 (McdAccountPresencePrivate, 1);

g_slice_new0 plz.

Otherwise looks good!
Comment 4 Senko Rasic 2010-08-26 06:30:57 UTC
(In reply to comment #3)
>   *
>   * Contact: Alberto Mardegan  <alberto.mardegan@nokia.com>
> 
> I guess he'd rather not be contacted about a file he's never touched? We could
> just bin that line.
> 
> +    priv = g_new0 (McdAccountPresencePrivate, 1);
> 
> g_slice_new0 plz.
> 
> Otherwise looks good!

Fixed those two and merged, thanks!
Comment 5 Simon McVittie 2010-09-06 04:38:09 UTC
Reopening for updated spec draft.
Comment 6 Senko Rasic 2010-09-08 03:07:54 UTC
Updated implementation to DRAFT2 of the spec.
Comment 7 Simon McVittie 2010-09-08 04:00:26 UTC
Looks good so far, but I think you're missing an implementation of MinimumPresenceRequestsChanged.
Comment 8 Senko Rasic 2010-09-08 05:22:48 UTC
(In reply to comment #7)
> Looks good so far, but I think you're missing an implementation of
> MinimumPresenceRequestsChanged.

Oops, indeed I do! Updated my branch to implement & test it.
Comment 9 Simon McVittie 2010-09-08 06:03:14 UTC
You've lost the (implicit) assertion that SetMinimumPresence doesn't fail. I'd prefer each call to call_async to be followed by an expectation that SetMinimumPresence returns successfully (dbus-return) and the signal is emitted (dbus-signal).

Depending on the semantics you want, you could either have an expect_many, or two expects in a specified order. I think we normally say setters should emit change notification before returning.
Comment 10 Simon McVittie 2010-11-10 06:34:42 UTC
(In reply to comment #9)
> You've lost the (implicit) assertion that SetMinimumPresence doesn't fail. I'd
> prefer each call to call_async to be followed by an expectation that
> SetMinimumPresence returns successfully (dbus-return) and the signal is emitted
> (dbus-signal).

It seems this was fixed in the branch at some point. review+
Comment 11 Will Thompson 2010-12-15 09:25:50 UTC
From the department of removing unused unstable API... MinimumPresence turns out to be unused after all. So here's a branch that removes it: http://git.collabora.co.uk/?p=user/wjt/telepathy-mission-control-wjt.git;a=shortlog;h=refs/heads/remove-MinimumPresence
Comment 12 Simon McVittie 2010-12-15 10:55:49 UTC
I like deletion of unused code.
Comment 13 Will Thompson 2010-12-21 11:02:50 UTC
Merged; will be in 5.7.2


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.