Bug 14620

Summary: Decide whether Connection.Connect() should be idempotent
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-specAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: minor    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-spec-smcv.git;a=shortlog;h=refs/heads/connect-is-idempotenthttp://git.collabora.co.uk/?p=user/smcv/telepathy-spec-smcv.git;a=shortlog;h=refs/heads/connect-is-idempotent
Whiteboard:
i915 platform: i915 features:

Description Simon McVittie 2008-02-22 04:00:25 UTC
libtelepathy and telepathy-glib assume that it's OK to call Connect() when the Connection is in the CONNECTING state.

telepathy-glib's tp_connection_run_until_ready() goes further, assuming that if the library user requested that Connect() be called if necessary, then it's OK to call it even before we know what the status is (i.e. before the first GetStatus() has returned).

In practice, I believe all Connect() implementations are idempotent, and silently return success at all times (unless the object has been destroyed as a result of a failed attempt to connect).

However, the spec says:

<tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
          The connection is already connecting or connected

(the markup is wrong though, so it doesn't show up in the HTML).

I'm inclined to say that Connect() should indeed be idempotent, and we should remove this possible error.

(When we've decided which it should be, please tell mardy - MC makes a similar assumption.)
Comment 1 Simon McVittie 2009-04-13 07:38:17 UTC
Can we just rubber-stamp the existing interpretation, which is that it's idempotent?

http://git.collabora.co.uk/?p=user/smcv/telepathy-spec-smcv.git;a=shortlog;h=refs/heads/connect-is-idempotent
Comment 2 Simon McVittie 2009-04-13 10:08:59 UTC
Yes
Comment 3 Simon McVittie 2009-04-14 05:52:58 UTC
Fixed in git, finally. Will be in 0.17.23

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.