Bug 23156 - replace handles with (namespace, identifier) tuples
Summary: replace handles with (namespace, identifier) tuples
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-spec (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard: incompatible
Keywords:
Depends on: 21787 Channel.Iface.Room
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-05 08:13 UTC by Simon McVittie
Modified: 2019-12-03 20:18 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2009-08-05 08:13:25 UTC
The strangeness of handles is justified by performance and normalization considerations for contacts, but not for all other handle types.

In Telepathy 1.0 (Bug #23148), fixing Bug #23151 will allow us to discard the Room handle type, and fixing Bug #21787 will allow us to discard the List and Group handle types.

Having done that, we can remove Channel.TargetHandleType altogether - it will implicitly be (TargetHandle == 0 ? NONE : CONTACT).
Comment 1 Simon McVittie 2010-12-01 02:55:10 UTC
In <https://bugs.freedesktop.org/show_bug.cgi?id=23155#c8> Will wrote:
> Brainstorming this with Rob, Pekka and Aki at the MeeGo Conference led to the
> following rough proposal for 1.0:
> 
>   • In the D-Bus API, replace handles with (ss) tuples, where the first field
> is the vCard field, and the second field is the contact ID.
>   • Cellular conference call-style meaningless channel-specific-handles could
> have a dummy namespace and look something like this: ("meaningless",
> "1234:really:tel:+441234567890").
>   • General channel-specific handles could have some similar convention. Or
> maybe we could use (sss) throughout.
> 
> Using tuples rather than just strings makes Addressing more native than it
> will be in 0.x; it also makes it more obvious to applications that they
> should only store things that the CM has normalized. The argument that
> applications will confuse normalized and non-normalized strings is fair,
> but applications not using bindings mess up handles, too, and in
> applications using bindings we can use the host language's type system
> to distinguish the two.
>
> Using strings throughout would make dbus-monitor traffic easier to read,
> would remove a whole section of Telepathy that currently needs
> explaining, and would also remove the memory-leak objection to
> immortal handles: CMs could forget contact ID tuples when they're done
> with them, safe in the knowledge that they can re-create them if a
> client uses one.
>
> (Internally, telepathy-glib's API could replace TpHandle with GObjects
> that get passed around implementing a particular interface...
> TpSvcContact, say. This preserves fast comparisons and so on.)

I agree with this proposal, except that I'm not sure about making the namespace portion be a vCard field. Normatively referencing vCard for ContactInfo is fine, but I'm not sure that our entire addressing model should be vCard when most of the protocols we deal with don't have an official vCard field.

Alternatives include: another externally-defined thing (URI scheme?), a string chosen by the CM (with "" denoting the protocol's "native" namespace perhaps), or the Telepathy name of the protocol (defined by tp-spec with scope for CM-specific extensions).
Comment 2 Mikhail Zabaluev 2010-12-07 05:49:19 UTC
(In reply to comment #1)
> or the Telepathy name of the protocol (defined by tp-spec with scope for
> CM-specific extensions).

I find this more consistent with other parts of the spec, such as Protocol.I.Addressing (e.g., you can easily map a contact to its corresponding protocol). I guess we'll need to keep the Addressing interfaces to maintain the conceptual barrier between non-normalized vCard and URI addresses and normalized contact tuples.
Comment 3 Mikhail Zabaluev 2011-10-10 03:56:30 UTC
(In reply to comment #1)
> I agree with this proposal, except that I'm not sure about making the namespace
> portion be a vCard field. Normatively referencing vCard for ContactInfo is
> fine, but I'm not sure that our entire addressing model should be vCard when
> most of the protocols we deal with don't have an official vCard field.

At least there is no stigma in inventing your own X- vCard fields as needed, such as there is with URL schemas. I think having one, standard-compliant where applicable, registry common between the handle namespace, the vCard part of Addressing, and ContactInfo is a big enough advantage.
Maybe it would be prudent to make a reservation that any X-names introduced in the Telepathy spec can be deprecated in favor of official vCard property names once those are standardized.
Comment 4 Xavier Claessens 2012-05-18 03:20:35 UTC
I think removing handles completely from the spec is a huge work that probably won't happen for 'next'. However in tp-glib's high-level API we already got ride of them all.

So I suggest removing this bug from blocking tp-spect-1.0
Comment 5 Jonny Lamb 2012-06-07 06:45:18 UTC
(In reply to comment #4)
> I think removing handles completely from the spec is a huge work that probably
> won't happen for 'next'. However in tp-glib's high-level API we already got
> ride of them all.
> 
> So I suggest removing this bug from blocking tp-spect-1.0

I completely agree. I'm removing the blocker now.
Comment 6 GitLab Migration User 2019-12-03 20:18:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-spec/issues/33.


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.