Bug 77194 - [next] avoid dbus-glib type for TpBaseChannelFillPropertiesFunc
Summary: [next] avoid dbus-glib type for TpBaseChannelFillPropertiesFunc
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on: 77189
Blocks: 68661 76369 77196
  Show dependency treegraph
 
Reported: 2014-04-08 17:58 UTC by Simon McVittie
Modified: 2019-12-03 20:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
TpBaseProtocol: GVariant-ify TpCMParamSpec (68.38 KB, patch)
2014-09-17 19:09 UTC, Simon McVittie
Details | Splinter Review
TpBaseChannel:fill_immutable_properties: Take a GVariantDict (29.99 KB, patch)
2014-09-17 19:10 UTC, Simon McVittie
Details | Splinter Review
tp_base_protocol_sanitize_parameters: set error if unable to coerce (1.03 KB, patch)
2014-09-17 19:10 UTC, Simon McVittie
Details | Splinter Review
tp_variant_convert: support converting to/from (u)int16 (6.03 KB, patch)
2014-09-17 19:10 UTC, Simon McVittie
Details | Splinter Review
tp_cm_param_filter_uint_nonzero: allow it to be used with guint16 (2.15 KB, patch)
2014-09-17 19:10 UTC, Simon McVittie
Details | Splinter Review
[gabble] Adapt to tp-glib: fill channel properties in terms of GVariant, redo TpCMParamSpec as objects (27.10 KB, patch)
2014-09-17 19:11 UTC, Simon McVittie
Details | Splinter Review
[idle] idle_tls_certificate_class_init: tp_dbus_properties_mixin_class_init has gone away (949 bytes, patch)
2014-09-17 19:12 UTC, Simon McVittie
Details | Splinter Review
[idle] Update for GVariant TpCMParamSpec and GVariant channel properties (10.07 KB, patch)
2014-09-17 19:12 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2014-04-08 17:58:08 UTC
+++ This bug was initially created as a clone of Bug #76369 +++

We should make sure that dbus-glib isn't exposed in our high-level API.

TpBaseChannelFillPropertiesFunc takes a GHashTable<string,GValue>.
Comment 1 Simon McVittie 2014-04-22 17:18:24 UTC
Xavier's gdbus-all branch fixes this, although it needs rebasing onto my branch from Bug #77189, and all the CMs need to catch up.

Review, ignoring the two trivial gtk-doc commits that I cherry-picked to my gdbus-object branch in Bug #77189:

----

5d0ab7f2: looks fine

----

805dfb02:

It isn't necessarily a huge problem that this lacks a regression test in telepathy-glib, because Idle and Gabble should be testing it.

+static void
+channel_died_cb (gpointer data,
+    GObject *deceased_channel)

How can this happen, now that we take a strong ref to the channel? (I think that strong ref is probably a mistake - isn't it circular?)

----

1460a071:

This is really Bug #77197 and I don't see how it relates to channels at all really, so I'll review it over there.

----

e664dd8b:

+  if (klass->fill_immutable_properties)
+    klass->fill_immutable_properties (chan, &properties);

No need for the conditional, the base class implements it. Not a blocker.

This commit does part of Bug #77197 too - it makes TpBaseProtocol's immutable properties GVariant-based. I can see that you wanted to avoid having to have both GHashTable and GVariantDict versions of tp_dbus_properties_mixin_fill_properties_hash(), but it still seems odd to me. Still, we want to do both eventually...

+          gchar *key = g_strdup_printf ("%s.%s", iface, property);
+
+          g_variant_dict_insert_value (dict, key,
+              dbus_g_value_build_g_variant (&value));
+          g_value_unset (&value);

key is leaked

> tp_dbus_properties_mixin_fill_properties_hash

This should have a different name now. No hash table is involved. fill_properties_dict?

----

General:

I think we should make TpBaseChannel and TpBasePasswordChannel use a non-TpSvc* skeleton on this bug too (or clone a bug), to keep all the channel stuff vaguely together. It can be a follow-up branch if that's easier.
Comment 2 Xavier Claessens 2014-04-24 20:43:54 UTC
(In reply to comment #1)
> Xavier's gdbus-all branch fixes this, although it needs rebasing onto my
> branch from Bug #77189, and all the CMs need to catch up.

Rebased my branch.

> 805dfb02:
> 
> +static void
> +channel_died_cb (gpointer data,
> +    GObject *deceased_channel)
> 
> How can this happen, now that we take a strong ref to the channel? (I think
> that strong ref is probably a mistake - isn't it circular?)

The code actually leaked priv->channel, set_property() shouldn't use g_value_dup_object(). I added a fixup commit that change it to be a GWeakRef.

> e664dd8b:
> 
> +  if (klass->fill_immutable_properties)
> +    klass->fill_immutable_properties (chan, &properties);
> 
> No need for the conditional, the base class implements it. Not a blocker.

Right, added a fixup.

> This commit does part of Bug #77197 too - it makes TpBaseProtocol's
> immutable properties GVariant-based. I can see that you wanted to avoid
> having to have both GHashTable and GVariantDict versions of
> tp_dbus_properties_mixin_fill_properties_hash(), but it still seems odd to
> me. Still, we want to do both eventually...

I did both because it's pretty trivial renaming and we have to stop TpBaseProtocol:immutable-properties from being a TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP anyway.

Are you ok leaving both in the same commit or do you want to split by having temporally both GVariantDict and GHashTable versions in properties mixin ?

> +          gchar *key = g_strdup_printf ("%s.%s", iface, property);
> +
> +          g_variant_dict_insert_value (dict, key,
> +              dbus_g_value_build_g_variant (&value));
> +          g_value_unset (&value);
> 
> key is leaked

Added fixup.

> > tp_dbus_properties_mixin_fill_properties_hash
> 
> This should have a different name now. No hash table is involved.
> fill_properties_dict?

I ran a s/_hash// on all files.

> ----
> 
> General:
> 
> I think we should make TpBaseChannel and TpBasePasswordChannel use a
> non-TpSvc* skeleton on this bug too (or clone a bug), to keep all the
> channel stuff vaguely together. It can be a follow-up branch if that's
> easier.

Yep, that's my goal :)
Comment 3 Simon McVittie 2014-09-17 19:09:43 UTC
Created attachment 106446 [details] [review]
TpBaseProtocol: GVariant-ify TpCMParamSpec

From: Xavier Claessens <xavier.claessens@collabora.com>

---

(Includes all fixup patches)
Comment 4 Simon McVittie 2014-09-17 19:10:02 UTC
Created attachment 106447 [details] [review]
TpBaseChannel:fill_immutable_properties: Take a  GVariantDict

From: Xavier Claessens <xavier.claessens@collabora.com>

---
(likewise)
Comment 5 Simon McVittie 2014-09-17 19:10:18 UTC
Created attachment 106448 [details] [review]
tp_base_protocol_sanitize_parameters: set error if unable  to coerce
Comment 6 Simon McVittie 2014-09-17 19:10:40 UTC
Created attachment 106449 [details] [review]
tp_variant_convert: support converting to/from (u)int16

Now that we're using native GVariant instead of GValue, (u)int16 can
happen.
Comment 7 Simon McVittie 2014-09-17 19:10:54 UTC
Created attachment 106450 [details] [review]
tp_cm_param_filter_uint_nonzero: allow it to be used with  guint16
Comment 8 Simon McVittie 2014-09-17 19:11:29 UTC
Created attachment 106451 [details] [review]
[gabble] Adapt to tp-glib: fill channel properties in terms of  GVariant, redo TpCMParamSpec as objects
Comment 9 Simon McVittie 2014-09-17 19:12:06 UTC
Created attachment 106452 [details] [review]
[idle] idle_tls_certificate_class_init:  tp_dbus_properties_mixin_class_init has gone away
Comment 10 Simon McVittie 2014-09-17 19:12:49 UTC
Created attachment 106453 [details] [review]
[idle] Update for GVariant TpCMParamSpec and GVariant channel  properties

---

I think this is right, but the tests just hang, so... maybe not.
Comment 11 Simon McVittie 2014-09-17 19:15:05 UTC
(In reply to comment #1)
> Xavier's gdbus-all branch fixes this, although it needs rebasing onto my
> branch from Bug #77189, and all the CMs need to catch up.

"All the CMs need to catch up" is secret code for "... and also, telepathy-glib needs to be fixed such that their tests can pass again".

I tried to land a greater proportion of gdbus-all at once, but my conclusion was "that's too much to do as one chunk of work and won't get finished".
Comment 12 GitLab Migration User 2019-12-03 20:43:16 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-glib/issues/126.


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.