Repository navigation
fix(leads): preserve canonical master identity during dedup merge - #109
Merged
Merged
Conversation
POST /api/leads/dedup/merge fetched every id in duplicate_ids, merged them into the master and then deleted all of them. When the caller sends a whole cluster from /api/leads/dedup (which includes the master), the master was deleted along with the duplicates and the response still reported "merged". Leave the master out of the duplicates, merge a repeated id once, and reject a request whose only duplicate is the master. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
Deduplicate canonical store IDs so numeric aliases cannot delete the master. Add regression coverage for both lead stores.
debpalash
marked this pull request as ready for review
October 22, 2026 15:29
Owner
Author
|
Review validation update: all 40 focused tests pass locally. GitHub's full backend run passed 2276 tests, 134 skipped, 8 deselected on 2826d27; PostgreSQL integrity/tenancy and frontend lint/tests/build also passed. The browser regression job is still in its Chromium installation step, so I have left this PR unmerged pending that check. The local full-suite attempt was not clean (2266 passed, 10 failed); missing SOCKS support explains seven failures, and the benchmark and two legacy search tests also failed in this host. The independent GitHub backend run passes all ten of those tests. Direct PostgreSQL endpoint merge regression coverage has not been added; the two-store endpoint fixture exercises LeadDB and PgLeadStore-on-SQLite. |
Record the author's DCO certification for correction commit 2826d27 without changing its tree or rewriting the original contributor history. Signed-off-by: Palash Debnath <4178343+debpalash@users.noreply.github.com>
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.
Extends #99, retaining rudycelekli's original commit, to close a remaining master-deletion path. Text comparisons let SQLite and the ORM store resolve
"01",1.0,"+1", and" 1 "to master ID1, merge it, and delete it with a successful response.Compare canonical IDs returned by the store, exclude the resolved master, and deduplicate resolved duplicates. Master-only aliases return 400. Adds coverage for numeric aliases, repeated duplicates, aliased master inputs, empty inputs, and missing IDs across both stores.
Validation:
Direct modification of the contributor fork was denied by the integration. This branch preserves the contributor's original commit and adds the correction. Supersedes #99 when merged.