WAIT: Match interstitial duplicates on legal first name too#1826
Open
maebeale wants to merge 1 commit into
Open
WAIT: Match interstitial duplicates on legal first name too#1826maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
The new-person duplicate interstitial matched the typed first name (and its nickname variants) only against the stored first_name column. A returning registrant whose legal name lives in legal_first_name (with a nickname in first_name) slipped past the name check when they typed their legal name — the exact duplicate this surfaces is meant to prevent. Mirror the registration matcher (PublicRegistration#find_matching_person): match the first-name variants against either first_name or legal_first_name, and count a legal-name hit as an exact name match for badge/sort purposes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 22, 2026
| duplicate_ids.add(person.id) | ||
| exact_name = NicknameMap.normalize(person.first_name) == normalized_first | ||
| exact_name = NicknameMap.normalize(person.first_name) == normalized_first || | ||
| NicknameMap.normalize(person.legal_first_name) == normalized_first |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: A legal-name hit counts as an exact name match ("name match" badge + name-priority sort), matching how a first_name hit is treated. normalized_first is never blank here (guarded by if first_name.presence), so a nil/blank legal_first_name normalizes to "" and can't false-match.
maebeale
commented
Jun 22, 2026
| duplicate_ids.add(person.id) | ||
| exact_name = NicknameMap.normalize(person.first_name) == normalized_first | ||
| exact_name = NicknameMap.normalize(person.first_name) == normalized_first || | ||
| NicknameMap.normalize(person.legal_first_name) == normalized_first |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: A legal-name hit counts as an exact name match (name-match badge + name-priority sort), matching how a first_name hit is treated. normalized_first is never blank here (guarded by if first_name.presence), so a nil/blank legal_first_name normalizes to an empty string and can't false-match.
This file contains hidden or 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
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.
🤖 PR, suggested 👤 review level: 📖 Read — light-logic: small, contained change to the duplicate-person name query
What is the goal of this PR and why is this important?
The new-person duplicate interstitial matched the typed first name (and its nickname variants) only against the stored
first_namecolumn. A returning registrant whose legal name lives inlegal_first_name(nickname infirst_name) who types their legal name slipped past the name check — the exact duplicate the interstitial exists to surface.This is the follow-up to the registration-side fix (
PublicRegistration#find_matching_person), ported the other direction: high-recall instead of swapping in the conservative matcher.How did you approach the change?
first_nameorlegal_first_name(period/space normalized, mirroring the existing column normalization).Anything else to add?
Kept the interstitial's own normalization (strip
./spaces, nickname variants) rather than the registration matcher's plainLOWER— fully aligning the two normalizations is a separate, larger change and isn't needed to close this duplicate.