After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669915 - dconf-dbus support for change notification of multiple values broken
dconf-dbus support for change notification of multiple values broken
Status: RESOLVED FIXED
Product: dconf
Classification: Core
Component: dconf
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-11 23:59 UTC by Florian Boucault
Modified: 2012-02-12 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dbus watcher program (620 bytes, text/x-csrc)
2012-02-12 00:00 UTC, Florian Boucault
  Details
dconf keys setter program (498 bytes, text/x-csrc)
2012-02-12 00:01 UTC, Florian Boucault
  Details
Patch fixing the issue (485 bytes, patch)
2012-02-12 00:22 UTC, Florian Boucault
none Details | Review
dbus-1: fix change notifications for multiple keys (983 bytes, patch)
2012-02-12 18:40 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Florian Boucault 2012-02-11 23:59:49 UTC
When multiple values of a same path are changed in batch using g_settings_delay, notification received using dconf_dbus_client_subscribe have incorrect parameters.

Test case attached in the form of a client setting dconf keys using g_settings (broken.c) and a dconf dbus watcher that listens for changes (dbus_watcher.c).
To compile them:

gcc $(pkg-config --libs --cflags dconf-dbus-1 dconf dbus-glib-1) -o dbus_watcher dbus_watcher.c

gcc $(pkg-config --libs --cflags gio-2.0) -o broken broken.c

Then run ./dbus_watcher first and run ./broken then.


Current console output for dbus_watcher:

process 15623: type invalid 0 not a basic type
NOTIFY key /org/gnome/desktop/background/XXX
process 15623: type invalid 0 not a basic type
NOTIFY key /org/gnome/desktop/background/XXX

XXX is in fact a unicode character that GNOME's bugzilla won't let me type in.


Expected console output for dbus_watcher:

NOTIFY key /org/gnome/desktop/background/primary-color
NOTIFY key /org/gnome/desktop/background/secondary-color
Comment 1 Florian Boucault 2012-02-12 00:00:50 UTC
Created attachment 207370 [details]
dbus watcher program
Comment 2 Florian Boucault 2012-02-12 00:01:06 UTC
Created attachment 207371 [details]
dconf keys setter program
Comment 3 Florian Boucault 2012-02-12 00:21:00 UTC
And I found the fix, good day!
Comment 4 Florian Boucault 2012-02-12 00:22:24 UTC
Created attachment 207373 [details] [review]
Patch fixing the issue
Comment 5 Allison Karlitskaya (desrt) 2012-02-12 18:40:08 UTC
Created attachment 207404 [details] [review]
dbus-1: fix change notifications for multiple keys

This fixes a rather obvious misuse of the libdbus-1 message decoding
API.
Comment 6 Allison Karlitskaya (desrt) 2012-02-12 18:40:37 UTC
Attachment 207404 [details] pushed as ee1e314 - dbus-1: fix change notifications for multiple keys


Thanks for the fix.