fix: mergeFeatures에 타임스탬프 비교 추가 (이전 시간대 데이터 무시)

메인프로젝트(deckStore.ts:163)와 동일하게 기존 저장된 데이터의
receivedTimestamp보다 이전 시간대의 메시지는 무시하도록 수정.

이전: 모든 메시지를 무조건 덮어씀 → 오래된 메시지가 최신 데이터를
덮어쓰거나 삭제/다크시그널 처리된 선박을 부활시킴
이후: newTimestamp < currentFeature.receivedTimestamp이면 스킵

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
HeungTak Lee 2026-01-30 13:48:29 +09:00
부모 c4e40a0cef
커밋 5eac7678bf

파일 보기

@ -336,6 +336,14 @@ const useShipStore = create(subscribeWithSelector((set, get) => ({
return; 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); const hasActive = isAnyEquipmentActive(ship);
// 규칙 1: LOST=0(영해 내) + 모든 장비 비활성 → 저장하지 않음 (완전 삭제) // 규칙 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 });
}); });
// 버전 카운터 증가 // 버전 카운터 증가