Skip to content

allow the same duplicate/merge to be suggested multiple times - #2782

Merged
chris48s merged 1 commit into
masterfrom
duplicates20260716
Aug 10, 2026
Merged

allow the same duplicate/merge to be suggested multiple times#2782
chris48s merged 1 commit into
masterfrom
duplicates20260716

Conversation

@chris48s

Copy link
Copy Markdown
Member

Refs https://app.asana.com/1/1204880536137786/project/1204880927741389/task/1214041815638938?focus=true

This PR:

  • Allows more than one DuplicateSuggestion for the same pair of people. You still can't have a duplicate if one is open
  • Surfaces any previous rejections in the DuplicatePersonView (suggest a duplicate) and DuplicateSuggestionListView (review duplicates)
  • Update + add tests

Example output:

Screenshot at 2026-07-16 10-32-10

This PR is mostly Claude with a bit of my own guidance/judgement/review.

from duplicates.models import DuplicateSuggestion


def get_previous_rejections(pairs):

@chris48s chris48s Jul 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was in two minds about whether this should assume the pairs are ordered (low, high) or accept them in any order.
I decided to go with assuming they're in (low, high) order because it makes it simpler what the function should return.

To work an example, lets say there is a DuplicateSuggestion record DuplicateSuggestion(person=1, other_person=2)

The way this works now, get_previous_rejections([(1,2)]) returns {(1,2): [DuplicateSuggestion(person=1, other_person=2)]} and get_previous_rejections([(2,1)]) returns {}

If I make it so that get_previous_rejections([(2,1)]) matches that record too it is ambiguous to me whether the output should be:

{
    (1,2): [DuplicateSuggestion(person=1, other_person=2)]
}

or

{
    (2,1): [DuplicateSuggestion(person=1, other_person=2)]
}

or

{
    (1,2): [DuplicateSuggestion(person=1, other_person=2)],
    (2,1): [DuplicateSuggestion(person=1, other_person=2)],
}

I feel like saying "the inputs have to be ordered and so is the output" just makes things simpler.

I could change it though, if we want.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, we decided to always go with ordered in the rest of this feature, so let's stick with that here. I think it also makes it clearer that high IDs always merge down to low IDs

@chris48s
chris48s merged commit 394b417 into master Aug 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants