From 5eac7678bfc666473920778c7a6fbce9f6cbb81c Mon Sep 17 00:00:00 2001 From: HeungTak Lee Date: Fri, 30 Jan 2026 13:48:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20mergeFeatures=EC=97=90=20=ED=83=80?= =?UTF-8?q?=EC=9E=84=EC=8A=A4=ED=83=AC=ED=94=84=20=EB=B9=84=EA=B5=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(=EC=9D=B4=EC=A0=84=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EB=8C=80=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=AC=B4=EC=8B=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 메인프로젝트(deckStore.ts:163)와 동일하게 기존 저장된 데이터의 receivedTimestamp보다 이전 시간대의 메시지는 무시하도록 수정. 이전: 모든 메시지를 무조건 덮어씀 → 오래된 메시지가 최신 데이터를 덮어쓰거나 삭제/다크시그널 처리된 선박을 부활시킴 이후: newTimestamp < currentFeature.receivedTimestamp이면 스킵 Co-Authored-By: Claude Opus 4.5 --- src/stores/shipStore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stores/shipStore.js b/src/stores/shipStore.js index 727c4a8a..c3ff18f4 100644 --- a/src/stores/shipStore.js +++ b/src/stores/shipStore.js @@ -336,6 +336,14 @@ const useShipStore = create(subscribeWithSelector((set, get) => ({ return; } + // 타임스탬프 비교: 기존 데이터보다 오래된 메시지는 무시 + // 참조: mda-react-front/src/shared/model/deckStore.ts - mergeFeatures (line 163) + const newTimestamp = parseReceivedTime(ship.receivedTime); + const currentFeature = features.get(featureId); + if (currentFeature && newTimestamp < currentFeature.receivedTimestamp) { + return; // 이전 시간대 데이터 → 무시 + } + const hasActive = isAnyEquipmentActive(ship); // 규칙 1: LOST=0(영해 내) + 모든 장비 비활성 → 저장하지 않음 (완전 삭제) @@ -355,7 +363,7 @@ const useShipStore = create(subscribeWithSelector((set, get) => ({ } } - features.set(featureId, { ...ship, receivedTimestamp: parseReceivedTime(ship.receivedTime) }); + features.set(featureId, { ...ship, receivedTimestamp: newTimestamp }); }); // 버전 카운터 증가