Merge lp:~jamesh/whoopsie-preferences/bug-1720331 into lp:whoopsie-preferences
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 72 | ||||
Proposed branch: | lp:~jamesh/whoopsie-preferences/bug-1720331 | ||||
Merge into: | lp:whoopsie-preferences | ||||
Diff against target: |
81 lines (+27/-13) 3 files modified
configure.ac (+1/-1) debian/changelog (+14/-0) src/whoopsie-preferences.c (+12/-12) |
||||
To merge this branch: | bzr merge lp:~jamesh/whoopsie-preferences/bug-1720331 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daisy Pluckers | Pending | ||
Review via email: mp+332105@code.launchpad.net |
Commit message
Don't export object on the bus until it has been fully constructed.
Description of the change
Don't export object on the bus until it has been fully constructed.
As well as ensuring that the WhoopsiePreferences object is usable as soon as it attaches to the bus, it also silences a PropertiesChanged signal broadcast during startup as whoopsie-
This helps avoid confusion when whoopsie-
1. C->S SetReportCrashe
2. dbus-daemon activates whoopsie-
3. S->C PropertiesChang
4. S->C SetReportCrashes method return message
5. S->C PropertiesChang
Here, the first signal broadcast at (3) is unwanted, and can confuse the client into thinking that its change has been ignored or some other client has changed the state.
By setting the initial values for the properties before exporting on the bus, the initial signal broadcast is avoided.
The difference can be demonstrated by running the following command in one terminal:
sudo dbus-monitor --system 'interface= com.ubuntu. WhoopsiePrefere nces' 'interface= org.freedesktop .DBus.Propertie s,arg0= com.ubuntu. WhoopsiePrefere nces'
And then in another terminal compare starting the old version of whoopsie- preferences vs. the version from this branch. The spurious signal is gone.
Using d-feet to call SetReportCrashes shows that PropertiesChanged is still sent when a change actually happens though.