Skip to content

Commit

Permalink
Sort merge suggestions by confidence (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Reyero authored and sausage-todd committed Nov 9, 2023
1 parent c96d099 commit 4a056d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/src/database/repositories/memberRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class MemberRepository {
AND ms."segmentId" IN (:segmentIds)
) AS "membersToMerge"
ORDER BY
"membersToMerge"."joinedAt" DESC
"membersToMerge"."similarity" DESC
LIMIT :limit OFFSET :offset
`,
{
Expand Down
4 changes: 2 additions & 2 deletions backend/src/services/__tests__/tenantService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ describe('TenantService tests', () => {
const member3 = await memberService.upsert(memberToCreate3)
let member4 = await memberService.upsert(memberToCreate4)

await memberService.addToMerge([{ members: [member1.id, member2.id], similarity: null }])
await memberService.addToMerge([{ members: [member3.id, member4.id], similarity: null }])
await memberService.addToMerge([{ members: [member1.id, member2.id], similarity: 1 }])
await memberService.addToMerge([{ members: [member3.id, member4.id], similarity: 0.5 }])

member2 = await memberService.findById(member2.id)
member4 = await memberService.findById(member4.id)
Expand Down

0 comments on commit 4a056d5

Please # to comment.