Skip to contentSkip to conversation

gdbus: Fix not emiting PropertiesChanged

PATCH In review Luiz Augusto von Dentz 2 participants 7 messages Nov 21, 2017 – Nov 22, 2017 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 gdbus: Fix not emiting PropertiesChanged

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause process_properties_from_interface to clear data->pending_prop when it should only clear the iface->pending_prop.

---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +2 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void process_properties_from_interface(struct generic_data *data,
 	DBusMessageIter iter, dict, array;
 	GSList *invalidated;
 
-	data->pending_prop = FALSE;
-
 	if (iface->pending_prop == NULL)
 		return;
 
@@ -1722,6 +1720,8 @@ static void process_property_changes(struct generic_data *data)
 {
 	GSList *l;
 
+	data->pending_prop = FALSE;
+
 	for (l = data->interfaces; l != NULL; l = l->next) {
 		struct interface_data *iface = l->data;
 
Signature · 1 line
2.13.6
#1 lore raw
Quoted 1 line

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 3 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 2 lines

process_properties_from_interface to clear data->pending_prop when it should only clear the iface->pending_prop.

I prefer my version, which allows the pending properties to be cleared out if the pending ones were for that interface. I also prefer the subject line I used, describing the actual problem it fixes, and the commit message going more into details.

But up to you.

Cheers

Quoted 28 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +2 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void
 process_properties_from_interface(struct generic_data *data,
 	DBusMessageIter iter, dict, array;
 	GSList *invalidated;
 
-	data->pending_prop = FALSE;
-
 	if (iface->pending_prop == NULL)
 		return;
@@ -1722,6 +1720,8 @@ static void process_property_changes(struct
 generic_data *data)
 {
 	GSList *l;
 
+	data->pending_prop = FALSE;
+
 	for (l = data->interfaces; l != NULL; l = l->next) {
 		struct interface_data *iface = l->data;
author maintainer
#2 lore raw

Hi Bastien,

Quoted 11 lines · Bastien Nocera
Quoted 1 line

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 3 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 7 lines
Quoted 2 lines

process_properties_from_interface to clear data->pending_prop when it should only clear the iface->pending_prop.

I prefer my version, which allows the pending properties to be cleared out if the pending ones were for that interface. I also prefer the subject line I used, describing the actual problem it fixes, and the commit message going more into details.

I guess this one is simpler to maintain, also notice that iterating in the data->interfaces to check if there are no other pending_prop has almost the same effect as process_property_changes, what would make a difference would be to prevent process_changes but that has to run anyway to propagate the interfaces added/removed. Also notice that data->pending_prop is clear earlier than the original fix for duplicated signals, the one that introduced this problem, that way we don't reintroduce the original problem.

Regarding the commit message, we usually avoid BlueZ specific description there as gdbus is shared with other projects.

Quoted 33 lines

But up to you.

Cheers

Quoted 28 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +2 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void
 process_properties_from_interface(struct generic_data *data,
      DBusMessageIter iter, dict, array;
      GSList *invalidated;
 
-     data->pending_prop = FALSE;
-
      if (iface->pending_prop == NULL)
              return;
@@ -1722,6 +1720,8 @@ static void process_property_changes(struct
 generic_data *data)
 {
      GSList *l;
 
+     data->pending_prop = FALSE;
+
      for (l = data->interfaces; l != NULL; l = l->next) {
              struct interface_data *iface = l->data;
Signature · 1 line
Luiz Augusto von Dentz
author maintainer Applied
#3 lore raw

Hi,

Quoted 62 lines · Luiz Augusto von Dentz

Hi Bastien,

Quoted 11 lines · Bastien Nocera
Quoted 1 line

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 3 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 7 lines
Quoted 2 lines

process_properties_from_interface to clear data->pending_prop when it should only clear the iface->pending_prop.

I prefer my version, which allows the pending properties to be cleared out if the pending ones were for that interface. I also prefer the subject line I used, describing the actual problem it fixes, and the commit message going more into details.

I guess this one is simpler to maintain, also notice that iterating in the data->interfaces to check if there are no other pending_prop has almost the same effect as process_property_changes, what would make a difference would be to prevent process_changes but that has to run anyway to propagate the interfaces added/removed. Also notice that data->pending_prop is clear earlier than the original fix for duplicated signals, the one that introduced this problem, that way we don't reintroduce the original problem.

Regarding the commit message, we usually avoid BlueZ specific description there as gdbus is shared with other projects.

Quoted 28 lines

But up to you.

Cheers

Quoted 23 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +0 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void
 process_properties_from_interface(struct generic_data *data,
      DBusMessageIter iter, dict, array;
      GSList *invalidated;
 
-     data->pending_prop = FALSE;
-
      if (iface->pending_prop == NULL)
              return;
@@ -1722,6 +1720,8 @@ static void process_property_changes(struct
 generic_data *data)
 {
      GSList *l;
 
Quoted 5 lines
Quoted 5 lines

gdbus/object.c static void process_property_changes(struct generic_data *data) · line 1726

Quoted 5 lines
gdbus/object.c +2 -0
+     data->pending_prop = FALSE;
+
      for (l = data->interfaces; l != NULL; l = l->next) {
              struct interface_data *iface = l->data;

Applied.

Signature · 1 line
Luiz Augusto von Dentz
#4 lore raw
Quoted 77 lines · Luiz Augusto von Dentz

Hi,

Quoted 73 lines · Luiz Augusto von Dentz

Hi Bastien,

On Wed, Nov 22, 2017 at 12:05 AM, Bastien Nocera <[email protected]

Quoted 17 lines
Quoted 1 line · wrote:

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 4 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 3 lines

process_properties_from_interface to clear data->pending_prop when it
should only clear the iface->pending_prop.

Quoted 7 lines

I prefer my version, which allows the pending properties to be cleared
out if the pending ones were for that interface. I also prefer the
subject line I used, describing the actual problem it fixes, and the
commit message going more into details.

I guess this one is simpler to maintain, also notice that iterating in
the data->interfaces to check if there are no other pending_prop has
almost the same effect as process_property_changes, what would make a
difference would be to prevent process_changes but that has to run anyway to propagate the interfaces added/removed. Also notice that data->pending_prop is clear earlier than the original fix for duplicated signals, the one that introduced this problem, that way we
don't reintroduce the original problem.

Regarding the commit message, we usually avoid BlueZ specific description there as gdbus is shared with other projects.

Quoted 29 lines

But up to you.

Cheers

Quoted 24 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +0 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void
 process_properties_from_interface(struct generic_data *data,
      DBusMessageIter iter, dict, array;
      GSList *invalidated;
 
-     data->pending_prop = FALSE;
-
      if (iface->pending_prop == NULL)
              return;
@@ -1722,6 +1720,8 @@ static void

process_property_changes(struct
generic_data *data)

 {
      GSList *l;
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

gdbus/object.c static void process_property_changes(struct generic_data *data) · line 1726

Quoted 5 lines
gdbus/object.c +2 -0
+     data->pending_prop = FALSE;
+
      for (l = data->interfaces; l != NULL; l = l->next) {
              struct interface_data *iface = l->data;

Applied.

You could at least have applied fixes to the 2 typos I mentioned :(

author maintainer
#5 lore raw

Hi Bastien,

Quoted 86 lines · Bastien Nocera
Quoted 77 lines · Luiz Augusto von Dentz

Hi,

Quoted 73 lines · Luiz Augusto von Dentz

Hi Bastien,

On Wed, Nov 22, 2017 at 12:05 AM, Bastien Nocera <[email protected]

Quoted 17 lines
Quoted 1 line · wrote:

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 4 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 3 lines

process_properties_from_interface to clear data->pending_prop when it
should only clear the iface->pending_prop.

Quoted 7 lines

I prefer my version, which allows the pending properties to be cleared
out if the pending ones were for that interface. I also prefer the
subject line I used, describing the actual problem it fixes, and the
commit message going more into details.

I guess this one is simpler to maintain, also notice that iterating in
the data->interfaces to check if there are no other pending_prop has
almost the same effect as process_property_changes, what would make a
difference would be to prevent process_changes but that has to run anyway to propagate the interfaces added/removed. Also notice that data->pending_prop is clear earlier than the original fix for duplicated signals, the one that introduced this problem, that way we
don't reintroduce the original problem.

Regarding the commit message, we usually avoid BlueZ specific description there as gdbus is shared with other projects.

Quoted 29 lines

But up to you.

Cheers

Quoted 24 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +0 -2
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void
 process_properties_from_interface(struct generic_data *data,
      DBusMessageIter iter, dict, array;
      GSList *invalidated;
 
-     data->pending_prop = FALSE;
-
      if (iface->pending_prop == NULL)
              return;
@@ -1722,6 +1720,8 @@ static void

process_property_changes(struct
generic_data *data)

 {
      GSList *l;
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

gdbus/object.c static void process_property_changes(struct generic_data *data) · line 1726

Quoted 5 lines
gdbus/object.c +2 -0
+     data->pending_prop = FALSE;
+
      for (l = data->interfaces; l != NULL; l = l->next) {
              struct interface_data *iface = l->data;

Applied.

Quoted 1 line

You could at least have applied fixes to the 2 typos I mentioned :(

You mean the one typo in the description, and instead of an, or did I miss something in the code?

Signature · 1 line
Luiz Augusto von Dentz
#6 lore raw
Quoted 103 lines · Luiz Augusto von Dentz

Hi Bastien,

Quoted 99 lines · Bastien Nocera
Quoted 97 lines · Luiz Augusto von Dentz

Hi,

Quoted 86 lines · Luiz Augusto von Dentz

Hi Bastien,

On Wed, Nov 22, 2017 at 12:05 AM, Bastien Nocera <hadess@hadess .net

Quoted 19 lines
Quoted 1 line · wrote:

Re: [PATCH BlueZ] gdbus: Fix not emiting PropertiesChanged

emitting.

Quoted 4 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If and interface is removed while properties are pending it would cause

"an interface".

Quoted 4 lines

process_properties_from_interface to clear data-

Quoted 1 line

pending_prop

when it
should only clear the iface->pending_prop.

Quoted 10 lines

I prefer my version, which allows the pending properties to be
cleared
out if the pending ones were for that interface. I also prefer
the
subject line I used, describing the actual problem it fixes, and
the
commit message going more into details.

I guess this one is simpler to maintain, also notice that iterating
in
the data->interfaces to check if there are no other pending_prop
has
almost the same effect as process_property_changes, what would make
a
difference would be to prevent process_changes but that has to run
anyway to propagate the interfaces added/removed. Also notice that
data->pending_prop is clear earlier than the original fix for duplicated signals, the one that introduced this problem, that way
we
don't reintroduce the original problem.

Regarding the commit message, we usually avoid BlueZ specific description there as gdbus is shared with other projects.

Quoted 30 lines

But up to you.

Cheers

Quoted 25 lines
---
 gdbus/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
gdbus/object.c +0 -0
index afb458764..5c8ad7a55 100644
@@ -1659,8 +1659,6 @@ static void

process_properties_from_interface(struct generic_data *data,

      DBusMessageIter iter, dict, array;
      GSList *invalidated;
gdbus/object.c +0 -2
-     data->pending_prop = FALSE;
-
      if (iface->pending_prop == NULL)
              return;
@@ -1722,6 +1720,8 @@ static void

process_property_changes(struct
generic_data *data)

 {
      GSList *l;
Quoted 5 lines
Quoted 5 lines

gdbus/object.c static void process_property_changes(struct generic_data *data) · line 1726

Quoted 5 lines
gdbus/object.c +2 -0
+     data->pending_prop = FALSE;
+
      for (l = data->interfaces; l != NULL; l = l->next) {
              struct interface_data *iface = l->data;

Applied.

Quoted 4 lines
Quoted 1 line

You could at least have applied fixes to the 2 typos I mentioned :(

You mean the one typo in the description, and instead of an, or did I miss something in the code?

There's a typo in the commit subject and another in the commit body. I mentioned both of those in my initial review.