From eac181f1b56d4ebb499ab6584d22e534f37526b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 21 May 2026 22:38:04 +0200 Subject: [PATCH] fix(catalog-backend): fix immediate mode logging on repeated calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A second call with mode='immediate' would incorrectly log "Unknown strategy mode" because the deprecation flag was already set. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- plugins/catalog-backend/src/stitching/types.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend/src/stitching/types.ts b/plugins/catalog-backend/src/stitching/types.ts index 5e11f17fab..5bcbf3f68b 100644 --- a/plugins/catalog-backend/src/stitching/types.ts +++ b/plugins/catalog-backend/src/stitching/types.ts @@ -37,11 +37,13 @@ export function stitchingStrategyFromConfig( 'catalog.stitchingStrategy.mode', ); - if (strategyMode === 'immediate' && !immediateDeprecationLogged) { - immediateDeprecationLogged = true; - options?.logger?.warn( - "The 'immediate' stitching strategy mode has been removed and is no longer supported. Falling back to deferred stitching. Please remove the 'catalog.stitchingStrategy.mode' configuration key.", - ); + if (strategyMode === 'immediate') { + if (!immediateDeprecationLogged) { + immediateDeprecationLogged = true; + options?.logger?.warn( + "The 'immediate' stitching strategy mode has been removed and is no longer supported. Falling back to deferred stitching. Please remove the 'catalog.stitchingStrategy.mode' configuration key.", + ); + } } else if (strategyMode !== undefined && strategyMode !== 'deferred') { options?.logger?.warn( `Unknown stitching strategy mode '${strategyMode}', falling back to deferred stitching. Please remove or correct the 'catalog.stitchingStrategy.mode' configuration key.`,