I have four people in my contact list called Aleix.
When I merge them my dialog looks like this:
(ignore the fact that you see Sven's avatar here, I changed his name in an address book)
there's only 4 contacts in there but 6 matches. When we do a merge we start all 4 'simultaneously' (as it's async) so kpeople thinks it needs to create 3 new Pimo Persons... then naturally it all screws up.
Thanks to some debug in the URIs I put in some debug and we have the following matches:
contactA -> contactC
contactB -> contactC
contactA -> contactB
contactC -> contactD
contactA -> contactD
contactB -> contactD
I've fixed the actual merging - but I could use some help.
There's two places that are screwed the MergeDialog and the MatchResolver
both of which basically have QHash<Index, Matches> and merge everything by the first index - but as we can see above that's not clearly going to work. I tried making it look up either indexA or indexB in the hash table but that's still not going to fix it.
Arguably we can just make the PersonsModel process each item in turn (harder than it sounds given we want to return the kjob) but that would still leave the MergeWidget broken.
I'm not sure of a neat fix, but it needs some thought into the design before coding.
This is a release blocker as it screws up the database.
Git commit 1fdd7dd9a12b744984c43e47fd86fa3d3c55b824 by Aleix Pol.
Committed on 13/09/2013 at 01:56.
Pushed by apol into branch 'master'.
Fix the matchers resolver in MatchesSolver job
Properly figure out how do we want to merge the contacts.
Not closing the bug since the GUI needs a similar fix. The important part
is fix fixed now, so we won't mess with the database.
M +40 -9 src/matchessolver.cpp