Bug 20776

Summary: Work out what to do about 16-bit types
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: major    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://cgit.freedesktop.org/~jonny/telepathy-spec/log/?h=16bit-types-20776
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 23148    

Description Simon McVittie 2009-03-20 11:40:48 UTC
dbus-glib is unable to emit 16-bit integers, so we can't comply with telepathy-spec in telepathy-glib. In practice, this means that our D-Bus API has never been what we claim, which is likely to cause problems for telepathy-qt4 (QtDBus is pickier about types).

Even if this is fixed in dbus-glib, using that fact would be an ABI break in telepathy-glib.

One possible solution is to declare that the API we implement in practice is the official one (by turning all our 16-bit integers 32 bits long), causing an ABI break in telepathy-qt4 (which is not yet considered stable anyway). This branch implements that, although it'll need updates for the current spec:

http://git.collabora.co.uk/?p=user/smcv/telepathy-spec-smcv.git;a=shortlog;h=refs/heads/16bit
Comment 1 Jonny Lamb 2012-04-06 15:09:10 UTC
(I vote we just defer this yet more until we move to GDBus where it will hopefully fix itself.)
Comment 2 Jonny Lamb 2012-05-10 06:14:46 UTC
Actually, we're not moving to GDBus yet and this is trivially "fixed" if we just s/q/u/g.

At the moment this is only used for IP socket ports, so, no harm done.

Let's do this for next. I will cook a patch.
Comment 3 Jonny Lamb 2012-05-10 09:44:12 UTC
Yes, here it is. Czech it out.
Comment 4 Simon McVittie 2012-05-10 09:56:33 UTC
Yes, please do, so this doesn't take another 3 years.

+ if self.dbus_type == 'q':
+ raise UntypedItem("Node referred to by '%r' has type 'q' which is unsupported "
+ "by dbus-glib; use 'u' instead" % self)

Please complain about int16 too (I think it's 'n').

I think "if 'n' in self.dbus_type or 'q' in self.dbus_type" would be a better check, to catch things like an a(sq) not qualified by a tp:type too.
Comment 5 Jonny Lamb 2012-06-07 06:42:18 UTC
(In reply to comment #4)
> Please complain about int16 too (I think it's 'n').

Done.

> I think "if 'n' in self.dbus_type or 'q' in self.dbus_type" would be a better
> check, to catch things like an a(sq) not qualified by a tp:type too.

Good idea.

I made these changes and pushed my updated commits. Thanks for the review.

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.