From 9f85367cdcce9da4e6c1d3187b59447fc93a0ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 22 May 2026 14:40:30 +0200 Subject: [PATCH] fix(catalog-backend): deduplicate entity IDs when marking for stitching after deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- .../operations/provider/deleteWithEagerPruningOfChildren.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/database/operations/provider/deleteWithEagerPruningOfChildren.ts b/plugins/catalog-backend/src/database/operations/provider/deleteWithEagerPruningOfChildren.ts index 7d2f699ea9..80efeace59 100644 --- a/plugins/catalog-backend/src/database/operations/provider/deleteWithEagerPruningOfChildren.ts +++ b/plugins/catalog-backend/src/database/operations/provider/deleteWithEagerPruningOfChildren.ts @@ -240,7 +240,7 @@ async function markEntitiesAffectedByDeletionForStitching(options: { // change, but not here - this code by its very definition is meant to not // leave any orphans behind, so we can simplify away that. const affectedIds = await knex - .select('refresh_state.entity_id AS entity_id') + .distinct('refresh_state.entity_id AS entity_id') .from('relations') .join( 'refresh_state',