fix: keep memberToMerge and memberToMergeRaw in sync (CM-1339)#4384
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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.
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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.
TransactionalSequelizeQueryExecutorinheritstx(), 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) => {
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.
Summary
Fixes cleanup so
memberToMergeandmemberToMergeRawstay 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
removeMemberToMergeto delete from both tables, in either pair orderaddMemberNoMerge→insertMemberNoMergeand update callersaddToMerge/ enrichment insert paths