-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Fix inconsistencies in duplicate retrieval #15160
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
eileenmcnaughton
force-pushed
the
dedupe8
branch
2 times, most recently
from
August 29, 2019 04:19
51ff32c
to
af8cc07
Compare
This was referenced Aug 29, 2019
Alternative to civicrm#15158 and civicrm#15153 fixing both the inconsistency & performance & making code more legible
eileenmcnaughton
force-pushed
the
dedupe8
branch
from
August 29, 2019 21:13
af8cc07
to
22912be
Compare
test this please |
pfigel
approved these changes
Sep 2, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one looks like the cleanest fix, 👍
(CiviCRM Review Template WORD-1.2)
- General standards
- Developer standards
- (
r-tech
) PASS:- Signature of
CRM_Dedupe_Finder::dupes
changed; all calls in core are compatible, universe shows no incompatible calls either - Change where non-matching criteria causes criteria to be ignored technically changes the contract but is a bugfix that restores sanity and fixes performance
- Signature of
- (
r-code
) PASS - (
r-maint
) PASS: Adds some tests - (
r-test
) PASS
- (
Thanks @pfigel I'm sure this caused you some brain pain too :-) But the code is inching towards sanity |
wmfgerrit
pushed a commit
to wikimedia/wikimedia-fundraising-crm
that referenced
this pull request
Sep 3, 2019
This is intended to address the test fail in https://gerrit.wikimedia.org/r/#/c/wikimedia/fundraising/crm/civicrm/+/533134/ We need to have the right permission for the test to pass once the 'supporting bug' is fixed, and it turns out we didn't Fix inconsistencies in duplicate retrieval I've submitted this upstream at civicrm/civicrm-core#15160 Alternative to civicrm/civicrm-core#15158 and civicrm/civicrm-core#15153 fixing both the inconsistency & performance & making code more legible Bug: T228826 Change-Id: Ie636d13ac05117b3fbce4c07e463c76e27fb764b
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Alternative to
Fix dedupe bug whereby the result of passing in criteria with no matches is to have it ignored
#15158
and
Performance improvement on dedupe find
#15153
as on further digging I realised that making the code more sensible would address both
Before
$pairs = $this->callAPISuccess('Dedupe', 'getduplicates', [
'rule_group_id' => 1,
'criteria' => ['contact' => ['id' => ['>' => 1000000000]]],
])
returns results if no contacts in the DB match the criteria
In addition the above query runs without a limit even when one is specified.
After
Above only returns results if contacts in the DB match the criteria.
The search_limit is respected when retrieving the contacts to match
Technical Details
Dedupe.getduplicates and duplicates retrieval in general respect 2 types of limit
Will fill the prevnext_cache with all pairs of contacts where one of the contacts match the criteria - ie first if finds all Bobs, then it fills the catch with all matches found for any of those Bobs given the rule. The api call returns ONLY the first pair due to limit => 1
Will find the first bob (search_limit is 1) and fill the prevnext_cache with all matches for that Bob and return as many pairs as it found
Comments
@pfigel another