fix(B05 배수유역): 369-2 화면 검증 흠 둘 — 몰랐던 낡음 409 = 지금 노선 길로 다시 · 되돌리기 = 그 걸음 초안 속성 · id
- 화면이 처음 열릴 때 「낡음」을 모르면 [자동 제안]이 409 오류로 끝나던 흠 — 곧바로 drainage/live 로 다시 - 되돌리기가 관 자리만 되살리고 속성은 지금 것을 끌고 가 [배관 배치 초기화] 뒤 되돌려도 세월교가 사라지던 흠 — 되살린 걸음의 관 초안(세션)이 같은 자리면 그 속성 · id 로(adoptDraftPipes) - 시험 — 349 흐름(409 → 다시) · 347 pipe id(초안 속성 되살림) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
@@ -21,7 +21,7 @@ function loadTs(file, real) {
|
||||
return box.exports;
|
||||
}
|
||||
|
||||
const { reconcilePipes } = loadTs(
|
||||
const { adoptDraftPipes, reconcilePipes } = loadTs(
|
||||
path.join(ROOT, "B05_Profile", "B05_Profile_UI_Drainage_Parts.ts"),
|
||||
["design_selection"],
|
||||
);
|
||||
@@ -35,5 +35,19 @@ process.stdout.write(
|
||||
moved: reconcilePipes(before, [100, 250]),
|
||||
added: reconcilePipes(before, [100, 200, 300]),
|
||||
twoMoved: reconcilePipes(before, [150, 250]),
|
||||
// 369 되돌리기 — 그 걸음 초안이 같은 자리면 초안 속성 · id 를 씀 · 다르면 null
|
||||
adopt: (() => {
|
||||
const next = [
|
||||
{ chainage_m: 100, reason: "user" },
|
||||
{ chainage_m: 200, reason: "user" },
|
||||
];
|
||||
const draft = [
|
||||
{ chainage_m: 100, id: "a1", facility: "ford_bridge" },
|
||||
{ chainage_m: 200.004, id: "b2" },
|
||||
];
|
||||
return { draft: adoptDraftPipes(draft, next), next };
|
||||
})(),
|
||||
adoptOther: adoptDraftPipes([{ chainage_m: 120, id: "z" }], [{ chainage_m: 100 }]),
|
||||
adoptNone: adoptDraftPipes(null, [{ chainage_m: 100 }]),
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -88,6 +88,7 @@ const state = new Map();
|
||||
const detailCalls = [];
|
||||
const detailAutos = []; // [자동 제안](369) 방식 — 없으면 null
|
||||
let records = 0; // 사진첩 한 걸음(369)
|
||||
let detailStale = false; // detail-basins 가 409 낡음으로 답함(369 — 화면이 몰랐던 낡음)
|
||||
let modeRow = 1; // ⚙ · [자동 제안] 창에서 고를 줄 — ⚙ 0 수동 · 1 자동 / 제안 0 전체 · 1 지정 포함
|
||||
const stubs = {
|
||||
"@config/config_frontend": { API_BASE_URL: "/api" },
|
||||
@@ -113,6 +114,7 @@ const stubs = {
|
||||
computeDetailBasins: async (projectId, points, auto) => {
|
||||
detailCalls.push(points);
|
||||
detailAutos.push(auto ?? null);
|
||||
if (detailStale) throw new Error("배수유역 낡음 — 노선이 분석 때와 다릅니다.");
|
||||
return { basins: [], pipe_points: points ?? [], stale: null };
|
||||
},
|
||||
},
|
||||
@@ -348,6 +350,21 @@ async function main() {
|
||||
remembered: remembered - remembered0,
|
||||
records: records - records0,
|
||||
};
|
||||
// 화면이 몰랐던 낡음 — 빠른 길이 409 낡음이면 곧바로 지금 노선으로 셈 길로 다시
|
||||
detailStale = true;
|
||||
modeRow = 0;
|
||||
const fallbackFrom = calls.length;
|
||||
propose.fire("click");
|
||||
await flush();
|
||||
const fallbackCall = calls[calls.length - 1];
|
||||
out.proposeFallback = {
|
||||
sent: calls.length - fallbackFrom,
|
||||
auto: fallbackCall.body.auto,
|
||||
status: status.textContent,
|
||||
};
|
||||
answer(fallbackCall);
|
||||
await flush();
|
||||
detailStale = false;
|
||||
// 저장 분석이 옛 노선(서버 낡음 답) → [업데이트] 뒤 [자동 제안] = 지금 노선으로 셈 길에 방식 실음
|
||||
await runner.run(async () => ({ basins: [], pipe_points: pipes, stale: "배수유역 낡음" }));
|
||||
update.fire("click");
|
||||
|
||||
@@ -95,3 +95,7 @@ def test_screen_reconcile_carries_id():
|
||||
assert result["moved"][1]["reason"] == "confirmed"
|
||||
assert [p.get("id") for p in result["added"]] == ["a1", "b2", None]
|
||||
assert [p.get("id") for p in result["twoMoved"]] == [None, None]
|
||||
adopt = result["adopt"]
|
||||
assert [p["id"] for p in adopt["next"]] == ["a1", "b2"] # 369 되돌리기 — 그 걸음 초안 id
|
||||
assert adopt["draft"][0]["facility"] == "ford_bridge"
|
||||
assert result["adoptOther"] is None and result["adoptNone"] is None
|
||||
|
||||
@@ -88,9 +88,12 @@ def test_자동_제안_두_방식_초기화_세류선만_한_걸음(r):
|
||||
"resetPoints": None,
|
||||
"resetAuto": None,
|
||||
"detailCalls": 0,
|
||||
"remembered": 5,
|
||||
"records": 5,
|
||||
"remembered": 6, # 앞 「409 → 다시」 한 번 포함
|
||||
"records": 6,
|
||||
}
|
||||
fallback = r["proposeFallback"]
|
||||
assert fallback["sent"] == 1 and fallback["auto"] == "all"
|
||||
assert "낡음" not in fallback["status"] # 409 글을 오류로 안 띄움(조용히 다시)
|
||||
|
||||
|
||||
def test_move_while_busy_cancels(r):
|
||||
|
||||
Reference in New Issue
Block a user