From 710169fd00d7065c65f0225dc0a4efbc85ee47d3 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 7 Sep 2026 01:09:58 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05):=20[3D=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8]=EA=B0=80=20=EB=A7=8C=EB=93=A0=20=EC=BD=94=EB=A6=AC?= =?UTF-8?q?=EB=8F=84=EB=A5=BC=20=EB=B0=94=EB=A1=9C=20=EC=98=AC=EB=A6=AC?= =?UTF-8?q?=EA=B3=A0=20=EB=B3=B4=EA=B4=80=ED=95=A8=EC=97=90=EB=8F=84=20?= =?UTF-8?q?=EB=8B=B4=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 보조 창 지적 — [3D 업데이트]를 눌러도 브라우저가 만들기만 하고 PUT 이 없었음. 저장 시점이 B05->B06 이동뿐이라(2026-08-23 확정), 누른 뒤 새로고침하면 저장본이 낡은 채라 다음 사람이 또 만들어야 했음. - 버튼 경로 끝에서 saveCorridorIfDirty 를 부름. - saveCorridorIfDirty 가 PUT 성공 뒤 그 봉투를 브라우저 보관함에도 담음(옛 열쇠 자리는 치움). 그러지 않으면 다음 진입이 새 열쇠 주소로 16.9MB 를 한 번 더 받았음. typecheck 통과. 실측 확인은 보조 창이 자기 프로젝트에서(저장본이 최신인 자리) 진행. Co-Authored-By: Claude Opus 5 (1M context) --- B05_Profile/B05_Profile_UI_Corridor.ts | 12 ++++++++++-- B05_Profile/B05_Profile_UI_Page.ts | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/B05_Profile/B05_Profile_UI_Corridor.ts b/B05_Profile/B05_Profile_UI_Corridor.ts index 58864d84..7ce3ea85 100644 --- a/B05_Profile/B05_Profile_UI_Corridor.ts +++ b/B05_Profile/B05_Profile_UI_Corridor.ts @@ -224,8 +224,16 @@ function markDirty(projectId: string, routeId: number): void { export async function saveCorridorIfDirty(projectId: string, routeId: number): Promise { const entry = cache.get(keyOf(projectId, routeId)); if (!entry || !entry.dirty) return; - const ok = await putStored(projectId, routeId, serialize(entry.build, entry.hash)); - if (ok) entry.dirty = false; + const envelope = serialize(entry.build, entry.hash); + const ok = await putStored(projectId, routeId, envelope); + if (!ok) return; + entry.dirty = false; + // 방금 올린 것을 **보관함에도** 담는다(2026-09-06) — 그러지 않으면 다음 진입이 열쇠가 + // 바뀐 주소로 한 번 더 받아 온다. 담아 두면 네트워크 없이 선다. + const url = `${corridorUrlPrefix(projectId, routeId)}?hash=${encodeURIComponent(entry.hash)}`; + const bytes = new TextEncoder().encode(JSON.stringify(envelope)).buffer as ArrayBuffer; + await purgeAssetsWithPrefix(projectId, corridorUrlPrefix(projectId, routeId)); + await writeCachedBytes(projectId, url, bytes); } /** Page 훅 — 현재 종횡단 정본 그대로 코리도를 확보해 뷰어에 반영(실패 시 제거). diff --git a/B05_Profile/B05_Profile_UI_Page.ts b/B05_Profile/B05_Profile_UI_Page.ts index a841c47a..bdc2df3b 100644 --- a/B05_Profile/B05_Profile_UI_Page.ts +++ b/B05_Profile/B05_Profile_UI_Page.ts @@ -322,6 +322,10 @@ export async function renderB05Route(root: HTMLElement): Promise { ); // 측점 바·라벨·램프도 계획고를 따라 움직여야 한다(2026-08-23 지적 ③). renderStationLines(currentSectionDetail); + // 만든 것을 **바로 올려 둔다**(2026-09-06) — 예전에는 B05→B06 이동 때만 올려서, + // 누른 뒤 새로고침하면 저장본이 낡은 채라 다음 사람이 또 만들어야 했다. + // 브라우저 보관함이 생긴 지금은 올려 두면 다음 진입이 네트워크 없이 선다. + void saveCorridorIfDirty(activeProjectId, latest.route.id); }, onMovePoint: viewer.beginMoveSelected, onDeletePoint: viewer.markers.deleteSelected,