Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dedupe fixes CRM-18442, CRM-18539, CRM-18480 #8251

Merged
merged 3 commits into from
May 19, 2016

Conversation

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton eileenmcnaughton force-pushed the merge_tests branch 3 times, most recently from 3c34db9 to d99c28e Compare May 18, 2016 04:58
@eileenmcnaughton eileenmcnaughton changed the title CRM-18842 Dedupe query: remove OR join in favour of more performant Union Dedupe fixes CRM-18842, CRM-18546 , CRM-18842, CRM-18539, CRM-18480 May 18, 2016
@eileenmcnaughton eileenmcnaughton changed the title Dedupe fixes CRM-18842, CRM-18546 , CRM-18842, CRM-18539, CRM-18480 Dedupe fixes CRM-18842, CRM-18546 , CRM-18539, CRM-18480 May 18, 2016
@eileenmcnaughton eileenmcnaughton changed the title Dedupe fixes CRM-18842, CRM-18546 , CRM-18539, CRM-18480 Dedupe fixes CRM-18442, CRM-18546 , CRM-18539, CRM-18480 May 18, 2016
@eileenmcnaughton
Copy link
Contributor Author

test this please

@JKingsnorth
Copy link
Contributor

Throwing an exception on trying to merge a deleted contact makes better sense. I was just recreating the logic here, which was silly of me:

CRM_Core_Error::fatal("contact id of $cid does not exist");

@JKingsnorth
Copy link
Contributor

Jenkins retest this please

@eileenmcnaughton
Copy link
Contributor Author

The tests have been pretty flakey today - but we can add the 'merge on pass' flag when you reach the point that you are happy with your QA & a passing test outcome is the remaining blocker

@JKingsnorth
Copy link
Contributor

JKingsnorth commented May 18, 2016

Warning: Missing argument 3 for CRM_Dedupe_Merger::getMergeCacheKeyString(), called in C:\xampp\htdocs\civi\sites\all\modules\civicrm\CRM\Contact\Page\DedupeFind.php on line 148

and I'm running through the manual tests now.

@JKingsnorth
Copy link
Contributor

JKingsnorth commented May 18, 2016

In fact this is being a bit hit and miss. I'm now hitting a huge number of e-notices, spotted in the drupal watchdog logs, about the AJAX dedupe finder page, and no duplicates are being detected:
Notice: Undefined variable: whereClause in CRM_Contact_Page_AJAX::getDedupes() (line 724 of C:\xampp\htdocs\civi\sites\all\modules\civicrm\CRM\Contact\Page\AJAX.php).

All similar to the above.

This is caused by the CRM-18539 commit.

I'm also running into an intermittent issue:
Use a dedupe rule no filtered by group - 90 results
Go back to 'Find and merge'
Use the dedupe rule filtered by a group - 0 results (expected 40)

But I've not been able to reliably recreate it against any particular commit yet =[

Grief. There's another issue at play here too regarding the prevNextCache not being updated and the duplicate finder not actually reflecting the most up to date information from peoples' records.

@JKingsnorth
Copy link
Contributor

JKingsnorth commented May 18, 2016

I've tested commit 664d553 (CRM-18546 Duplicate email addresses created when merging in 4.7) in isolation and it appears to work OK.

  • Tested safe merging contacts with duplicate email addresses - no duplicate email created (other fields migrated as expected)
  • Tested safe merging contacts with duplicate email address and conflicting addresses - caught as a conflict
  • Tested force merging those contacts - no duplicate email address added
  • Tested safe merging contacts with duplicate phones - no duplicate phone created either - yay
  • Tested a 'manual' merge and the add/overwrite options for location fields still work as expected

So I think that commit, in isolation, is good.

I wondered whether we should extend the test to check for duplicate phone numbers too - but I don't think it's necessary.

@JKingsnorth
Copy link
Contributor

Also identified https://issues.civicrm.org/jira/browse/CRM-18575 as part of QA on this.

@eileenmcnaughton
Copy link
Contributor Author

@JKingsnorth the commit you tried suucessfully isolated in this PR #8385 so if that is ok we can merge that PR.

@JKingsnorth
Copy link
Contributor

Yup. If that PR is the commit then go for it.
On 18 May 2016 21:07, "Eileen McNaughton" notifications@github.com wrote:

@JKingsnorth https://github.com/Jkingsnorth the commit you tried
suucessfully isolated in this PR #8385
#8385 so if that is ok we
can merge that PR.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8251 (comment)

@eileenmcnaughton
Copy link
Contributor Author

Can you add a comment to that commit to clarify it has been QAd? Then I'll take another look here - my best guess if the rebasing of 9e537ad is this issue. Ican split the patches out

…deleted contacts

Also, I changed the fatal to an exception - low level functions should throw exceptions, it's up to the form to catch & render those
…NION

Unions are much faster than OR joins. This change took the length of the query to get the dedupes on a large database from
'as long as it took for the server to fall over' to less than one second on a small group of contacts

This query is only affecting one path - ie Individuals - at the moment as I can only extend that as fast as I can write tests.
@eileenmcnaughton eileenmcnaughton changed the title Dedupe fixes CRM-18442, CRM-18546 , CRM-18539, CRM-18480 Dedupe fixes CRM-18442, CRM-18539, CRM-18480 May 19, 2016
@eileenmcnaughton
Copy link
Contributor Author

@JKingsnorth I think I tracked down the errant cacheKeyStrings that had not been updated.

Regarding your list of regressions - I believe they are all 4.7 regressions but not specifically 4.7.8 regressions? I'd like to tackle them - but not without getting some testing into those ajax functions first, so I'd see getting some tests added as a blocker to starting fixing

@JKingsnorth
Copy link
Contributor

JIRA issue for adding tests: https://issues.civicrm.org/jira/browse/CRM-18581

@@ -163,7 +163,7 @@ public function testBatchMergeSelectedDuplicates() {

// Retrieve pairs from prev next cache table
$select = array('pn.is_selected' => 'is_selected');
$cacheKeyString = "merge Individual_{$dao->id}_{$this->_groupId}";
$cacheKeyString = "merge Individual_{$dao->id}_{$this->_groupId}_0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this use getMergeCacheKeyString ? Because it's in a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it should - I was in test-debug mode at that time

@JKingsnorth
Copy link
Contributor

JKingsnorth commented May 19, 2016

Confirmed that all the manual tests pass.

This PR also fixes CRM-18579.

I just made a couple of comments on the code. Once those are addressed (and QA'd), or pushed back, we can merge.

@eileenmcnaughton
Copy link
Contributor Author

I think it might be better to merge & then try to get to those as improvements because of the timeframe. I might struggle to get much done tomorrow. What do you think?

@JKingsnorth
Copy link
Contributor

Merge away, I'll note the UI improvement in the meta issue.

@deepak-srivastava If you get a chance to test this in the test week as well that would be great; I know you've done a lot of work around all this

@eileenmcnaughton eileenmcnaughton merged commit c5856e2 into civicrm:master May 19, 2016
@eileenmcnaughton eileenmcnaughton deleted the merge_tests branch May 19, 2016 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants