GActionGroupExporter: flush queue on requests
authorRyan Lortie <desrt@desrt.ca>
Thu, 21 May 2015 17:32:20 +0000 (12:32 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 5 Jun 2015 16:36:36 +0000 (12:36 -0400)
commit865ce79ce0e92326b247ef51e7e2c78aaad99889
treebf03488ea40276bd126366dbeec1e45e71a84926
parenteeae7950fca962e65a5e08cfceae372782f5cc7e
GActionGroupExporter: flush queue on requests

In order to maintain a logical stream of events, we need to make sure we
flush and queued change notifications before responding to any requests
for information from clients.

If we don't do this, it's possible that we emit an 'add' event that was
queued at the time of a 'DescribeAll' call _after_ the reply to that
call (which already contained the description of the new action).

In practice, this is not only logically incorrect, but it can also cause
problems.  If a change to action 'state' or 'enabled' occurs after the
DescribeAll but before the signal has been dispatched, it will be
ignored because an 'add' signal is already pending.  When that add
signal is sent, it will contain the correct data, but the receiver will
ignore it because it already saw the action in the DescribeAll reply.

https://bugzilla.gnome.org/show_bug.cgi?id=749693
gio/gactiongroupexporter.c