GNOME Bugzilla – Bug 629642
individuals-changed emitted in the wrong order
Last modified: 2010-09-21 09:32:49 UTC
I have in 4 contacts in Empathy and I merged 3 of them in a single individual called Marco Barisione (yes, I really like to talk to myself). If a create a folks aggregator, connect to individuals-changed and print what happens I get this (the hex value is the pointer to the individual): individuals-changed emitted: added: Marco Barisione 0x773910 individuals-changed emitted: removed: Marco Barisione 0x773910 individuals-changed emitted: removed: Marco Barisione 0x773a10 individuals-changed emitted: removed: Marco Barisione 0x773a90 individuals-changed emitted: added: Marco Barisione 0x773b10 added: Marco Barisione 0x773a90 added: Marco Barisione 0x773a10 added: echobot 0x773990 So my application gets confused (contacts get removed before being added) and shows 3 Marcos and 1 echobot.
Could you run your program with the FOLKS_DEBUG=all environment variable set please?
Created attachment 170240 [details] Log produced by folks
Created attachment 170354 [details] [review] Ensure Individuals are added before they're removed http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/629642-aggregator-signals This should fix the problem. Ultimately, we probably want to reconsider the interplay between the IndividualAggregator.individuals_changed and Individual.removed signals, taking into account the possibility of needing to know a replacement Individual when listening to IndividualAggregator.individuals_changed, the requirement that the API still be usable without IndividualAggregator, and the need to not have two signals to listen to in order to get the same information both times.
Review of attachment 170354 [details] [review]: Looks good. Please merge to 0.2.x and master.
(In reply to comment #3) > Ultimately, we probably want to reconsider the interplay between the > IndividualAggregator.individuals_changed and Individual.removed signals, taking > into account the possibility of needing to know a replacement Individual when > listening to IndividualAggregator.individuals_changed, the requirement that the > API still be usable without IndividualAggregator, and the need to not have two > signals to listen to in order to get the same information both times. Please add this to bug #629078
master: commit 797a0521987d2729de7fa1655f69d06dc7e42d9f Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Wed Sep 15 17:44:23 2010 +0100 Ensure Individuals are added before they're removed Rearrange the linking process slightly so that we can guarantee that Individuals won't be signalled as removed (or replaced) before they're signalled as added. Closes: bgo#629642 NEWS | 1 + folks/individual-aggregator.vala | 45 ++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 19 deletions(-) folks-0-2: commit dd0386400f74ab8918ee56755deb88f241f4a6f1 Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Wed Sep 15 17:44:23 2010 +0100 Ensure Individuals are added before they're removed Rearrange the linking process slightly so that we can guarantee that Individuals won't be signalled as removed (or replaced) before they're signalled as added. Closes: bgo#629642 NEWS | 6 +++++ folks/individual-aggregator.vala | 45 ++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 19 deletions(-)