From e9d83f2058a5f3e35a519b3e701096b9940f22de Mon Sep 17 00:00:00 2001 From: Macbook Date: Thu, 11 Jun 2026 00:30:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=8C=EB=A6=BC=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../useTradeNotificationSignalSnapshot.ts | 7 +++++ .../src/utils/resolveNotificationStrategy.ts | 28 ++++++++++++------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/frontend/src/hooks/useTradeNotificationSignalSnapshot.ts b/frontend/src/hooks/useTradeNotificationSignalSnapshot.ts index d77e2d3..2b06974 100644 --- a/frontend/src/hooks/useTradeNotificationSignalSnapshot.ts +++ b/frontend/src/hooks/useTradeNotificationSignalSnapshot.ts @@ -9,6 +9,7 @@ import { resolveNotificationStrategy, normalizeStrategyId, } from '../utils/resolveNotificationStrategy'; +import { isStrategyMissingOnServer } from '../utils/strategyMissingCache'; import { hydrateStrategyDto, normalizeMarketCode } from '../utils/strategyHydrate'; import { fetchLiveSnapshot, @@ -61,6 +62,12 @@ export function useTradeNotificationSignalSnapshot( emptyRetryRef.current = 0; return; } + // 서버에 없는 것으로 확인된 전략은 재요청하지 않음 + if (isStrategyMissingOnServer(rawId)) { + setSnapshot(undefined); + setLoading(false); + return; + } if (refreshInFlightRef.current) return; const gen = ++genRef.current; diff --git a/frontend/src/utils/resolveNotificationStrategy.ts b/frontend/src/utils/resolveNotificationStrategy.ts index 04d376f..2c08c8f 100644 --- a/frontend/src/utils/resolveNotificationStrategy.ts +++ b/frontend/src/utils/resolveNotificationStrategy.ts @@ -7,7 +7,11 @@ import { loadStrategyForNotification, type StrategyDto, } from './backendApi'; -import { reconcileStrategyMissingWithValidIds, unmarkStrategyMissingOnServer } from './strategyMissingCache'; +import { + isStrategyMissingOnServer, + reconcileStrategyMissingWithValidIds, + unmarkStrategyMissingOnServer, +} from './strategyMissingCache'; import { coerceFiniteNumber } from './safeFormat'; import { hydrateStrategyDto, normalizeMarketCode } from './strategyHydrate'; import { extractVirtualConditions } from './virtualStrategyConditions'; @@ -77,12 +81,14 @@ export async function resolveNotificationStrategy( if (fromList?.id != null && hasExtractableConditions(fromList)) { return pickStrategy(fromList, normalizedId); } - const loaded = await loadStrategyForNotification(normalizedId); - if (loaded && extractVirtualConditions(loaded).length > 0) { - return { strategy: loaded, strategyId: normalizedId }; - } - if (loaded) { - return { strategy: loaded, strategyId: normalizedId }; + if (!isStrategyMissingOnServer(normalizedId)) { + const loaded = await loadStrategyForNotification(normalizedId); + if (loaded && extractVirtualConditions(loaded).length > 0) { + return { strategy: loaded, strategyId: normalizedId }; + } + if (loaded) { + return { strategy: loaded, strategyId: normalizedId }; + } } } @@ -93,9 +99,11 @@ export async function resolveNotificationStrategy( if (hasExtractableConditions(byName)) { return pickStrategy(byName, byName.id); } - const loaded = await loadStrategyForNotification(byName.id); - if (loaded) { - return { strategy: loaded, strategyId: byName.id }; + if (!isStrategyMissingOnServer(byName.id)) { + const loaded = await loadStrategyForNotification(byName.id); + if (loaded) { + return { strategy: loaded, strategyId: byName.id }; + } } } }