알림 시간봉 오류 수정

This commit is contained in:
Macbook
2026-05-29 20:42:35 +09:00
parent a5f0a7eefd
commit 775f83e1b3
13 changed files with 200 additions and 35 deletions
+20 -3
View File
@@ -155,7 +155,9 @@ export function updateStartCandleTypes(
candleTypes: string[],
): EditorConditionState {
const types = normalizeCandleTypesList(candleTypes);
const primary = types[0];
// 조건 노드 left/rightCandleType 동기화는 "대표 분봉"에만 사용되므로,
// multi 분봉에서 stale 1m 이 앞에 오는 경우 1m 로 동기화되지 않도록 non-1m 을 우선한다.
const primary = types.find(ct => normalizeStartCandleType(ct) !== '1m') ?? types[0];
const nextMeta = {
...state.startMeta,
[startId]: { candleTypes: types, candleType: primary },
@@ -197,7 +199,13 @@ function normalizeCandleTypesList(types: string[]): string[] {
out.push(ct);
}
}
return out.length > 0 ? out : [DEFAULT_START_CANDLE];
if (out.length === 0) return [DEFAULT_START_CANDLE];
// 레거시/불일치로 multi 분봉에 stale 1m 이 섞인 경우가 있어,
// multi 인데 non-1m 이 있으면 1m 을 기본적으로 제외한다.
if (out.length > 1 && out.includes('1m') && out.some(ct => ct !== '1m')) {
return out.filter(ct => ct !== '1m');
}
return out;
}
function readTimeframeCandleTypes(node: LogicNode): string[] {
@@ -467,7 +475,16 @@ export function mergeStartMetaForLoad(
};
for (const [startId, meta] of Object.entries(decoded)) {
if (stored[startId]) {
const types = normalizeCandleTypesList(getStartCandleTypes(stored[startId]));
const storedTypes = normalizeCandleTypesList(getStartCandleTypes(stored[startId]));
const decodedTypes = normalizeCandleTypesList(getStartCandleTypes(meta));
// flow_layout_json 에 stale 1m 이 남아 있는 경우가 있어,
// DSL 에 1m 이 없고 non-1m 이 있으면 DSL 쪽을 우선한다.
const shouldPreferDecoded =
storedTypes.includes('1m')
&& storedTypes.some(ct => ct !== '1m')
&& !decodedTypes.includes('1m')
&& decodedTypes.some(ct => ct !== '1m');
const types = shouldPreferDecoded ? decodedTypes : storedTypes;
merged[startId] = { candleTypes: types, candleType: types[0] };
} else {
const types = normalizeCandleTypesList(getStartCandleTypes(meta));