Does the notify fetch the updated property in advance? Because reversing the order does fix a stale property issue when immediately fetching the property by the signal, e.g. when fetching the requested presence of a number of accounts in kci global presence, a stale presence can be brought in on a fresh signal and taint the global presence for that global presence change. The reason it doesn't happen every presence change is that the signal property isn't used anyway and the account property isn't yet changed to the new value and the current presence has a higher priority than the expected presence, causing the old presence to be kept. If the stale presence is higher priority when the last account signals this is how we get a stuck presence. Without this patch it is assumed that the signal is always right because it has a property attached and the notify line would seem redundant because it doesn't send any updated property. I like this approach reversed, because -any- signal comes after -any- consideration of the corresponding property, especially if the signal is used to query the property immediately. Either way, I've been using this patch to fix the global presence issue for a while now, it looks correct and doesn't seem to have any regressions. I briefly second-guessed also changing the serviceNameChanged and profileChanged signals, because the above behaviour may have been relied on so that the account was still adressable by these properties until the new property was useable and there doesn't seem to be any reason to rely on these properties to access the account while they are being changed anyway.


-------- Original message --------
From: bugzilla-daemon@freedesktop.org
Date: 11-02-2015 11:42 AM (GMT-07:00)
To: smithjd15@gmail.com
Subject: [Bug 92153] Account properties notify signals are dispatched before the account property is updated

Comment # 1 on bug 92153 from
I'm not sure I understand

parent->notify just emits propertyChanged("propertyName")


 * Notify that a property named \a propertyName changed.
 *
 * This method will emit propertyChanged() for \a propertyName.
 *
 * \todo Use for more classes beyond Account. Most importantly Contact.
 */
void Object::notify(const char *propertyName)
{
    emit propertyChanged(QLatin1String(propertyName));
}


As far as I can tell, the only user of this is AccountSet and some unit tests.

git grep propertyChanged
TelepathyQt/account-set.cpp:            SIGNAL(propertyChanged(QString)),
TelepathyQt/object.cpp: * This method will emit propertyChanged() for \a
propertyName.
TelepathyQt/object.cpp:    emit propertyChanged(QLatin1String(propertyName));
TelepathyQt/object.h:    void propertyChanged(const QString &propertyName);
tests/dbus/account-connection-factory.cpp:               
SIGNAL(propertyChanged(QString)),
tests/dbus/account-connection-factory.cpp:               
SIGNAL(propertyChanged(QString)),


As for requested presence; it's set on line 4466 and the emit is on line 4470,
so that's always set before the emit.


You are receiving this mail because: