Skip to content

fix: keep memberToMerge and memberToMergeRaw in sync (CM-1339)#4384

Merged
skwowet merged 3 commits into
mainfrom
bugfix/CM-1339
Jul 22, 2026
Merged

fix: keep memberToMerge and memberToMergeRaw in sync (CM-1339)#4384
skwowet merged 3 commits into
mainfrom
bugfix/CM-1339

Conversation

@skwowet

@skwowet skwowet commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes cleanup so memberToMerge and memberToMergeRaw stay in sync when suggestions are removed via no-merge, merge, or the LLM path. Also removes unused filtered-only insert helpers that made the two tables diverge.

Changes

  • Update removeMemberToMerge to delete from both tables, in either pair order
  • Route UI no-merge, merge, and LLM skip/reject cleanup through that shared helper
  • Insert no-merge rows in both directions on the LLM reject path
  • Rename addMemberNoMergeinsertMemberNoMerge and update callers
  • Remove dead filtered-only addToMerge / enrichment insert paths

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet self-assigned this Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Keeps member merge suggestion cleanup consistent across raw and filtered tables.

Changes:

  • Centralizes bidirectional suggestion deletion.
  • Adds symmetric no-merge records for LLM rejections.
  • Removes obsolete insertion helpers and renames the no-merge helper.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/libs/data-access-layer/src/old/apps/merge_suggestions_worker/memberMergeSuggestions.repo.ts Removes obsolete per-table deletion.
services/libs/data-access-layer/src/old/apps/members_enrichment_worker/index.ts Removes unused insertion helper.
services/libs/data-access-layer/src/member_merge/index.ts Deletes suggestions from both tables and renames insertion helper.
services/libs/common_services/src/services/member/unmerge.ts Updates renamed helper usage.
services/apps/merge_suggestions_worker/src/workflows/mergeMembersWithLLM.ts Uses centralized cleanup for LLM paths.
services/apps/merge_suggestions_worker/src/activities/memberMergeSuggestions.ts Centralizes cleanup and inserts bidirectional no-merge rows.
backend/src/services/memberService.ts Removes obsolete insertion service and redundant cleanup.
backend/src/database/repositories/memberRepository.ts Removes dead bulk insertion and updates helper usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/libs/data-access-layer/src/member_merge/index.ts Outdated
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

services/libs/data-access-layer/src/member_merge/index.ts:17

  • This nested transaction is not part of the caller's existing Sequelize transaction. TransactionalSequelizeQueryExecutor inherits tx(), which opens and commits a separate transaction (backend/src/database/sequelizeQueryExecutor.ts:85-110). In the UI no-merge path, the no-merge rows are therefore still uncommitted in the outer transaction while these deletes commit independently; if the outer transaction later rolls back, the suggestion is lost without a matching no-merge record. Use one data-modifying statement so both deletes remain atomic while honoring whichever transaction the supplied executor already represents.
  await qx.tx(async (tx) => {

@skwowet
skwowet merged commit e021298 into main Jul 22, 2026
13 checks passed
@skwowet
skwowet deleted the bugfix/CM-1339 branch July 22, 2026 14:05
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