Bug 324814 - Merging fundamentally broken
Summary: Merging fundamentally broken
Status: RESOLVED FIXED
Alias: None
Product: kpeople
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-11 21:55 UTC by David Edmundson
Modified: 2014-02-28 13:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2013-09-11 21:55:02 UTC
I have four people in my contact list called Aleix.

When I merge them my dialog looks like this:

http://wstaw.org/m/2013/09/11/plasma-desktopd30839.png
(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.
Comment 1 Aleix Pol 2013-09-13 01:56:15 UTC
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

http://commits.kde.org/libkpeople/1fdd7dd9a12b744984c43e47fd86fa3d3c55b824