From 0f54daf37be99177d21c9a75d5a6d2e49f48cf85 Mon Sep 17 00:00:00 2001 From: Matysh Date: Wed, 26 Aug 2026 01:03:44 +0300 Subject: [PATCH] fix: preserve passage validation during wall migration Issue: #282 User-Visible: yes --- custom_components/houseplan/websocket_api.py | 6 ++++++ docs/CHANGELOG.md | 2 ++ docs/CHANGELOG.ru.md | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/custom_components/houseplan/websocket_api.py b/custom_components/houseplan/websocket_api.py index 8851279f..7aa337cc 100755 --- a/custom_components/houseplan/websocket_api.py +++ b/custom_components/houseplan/websocket_api.py @@ -1647,6 +1647,12 @@ async def ws_plan_optimize(hass: HomeAssistant, connection, msg: dict[str, Any]) # validated verbatim: the backend must never invent lineage for a # graph already authored by a current client. candidate_config = CONFIG_SCHEMA(msg["config"]) + # Keep the established public validation contract ahead of the + # structural migration barrier. A malformed passage can also make + # wall-host materialisation impossible, but callers must still get + # the actionable `invalid_passage_fields` code rather than the + # generic wall-model blocker. + validate_opening_passages(candidate_config, config_data.get("config")) if submitted_model < WALL_SEGMENT_MODEL_VERSION: candidate_config, _ = commit_wall_segment_model(candidate_config) validated_config = CONFIG_SCHEMA(candidate_config) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e036c90c..37b70562 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -22,6 +22,8 @@ enforces this upgrade when invoked directly. An authored wall chain remains valid when it becomes a room or independent walls, while a rejected transaction stores no partial result and no longer reports false success. + An invalid open passage also retains its specific actionable error instead + of being masked by the generic wall-model migration blocker. Ambiguous legacy geometry is left unchanged with a recovery prompt. No Plan editor controls or zero-thickness-wall behaviour changed diff --git a/docs/CHANGELOG.ru.md b/docs/CHANGELOG.ru.md index 23165d03..d4fd6730 100755 --- a/docs/CHANGELOG.ru.md +++ b/docs/CHANGELOG.ru.md @@ -26,7 +26,9 @@ серверная транзакция Optimize также гарантирует это обновление при прямом вызове. Принятая пользователем цепочка остаётся допустимой при преобразовании в комнату или независимые стены, а отклонённая транзакция не записывает - частичный результат и не показывает ложное сообщение об успехе. + частичный результат и не показывает ложное сообщение об успехе. Невалидный + открытый проход по-прежнему получает своё точное сообщение об ошибке, а не + общий блокер миграции стен. Неоднозначная старая геометрия остаётся без изменений с подсказкой по восстановлению. Кнопки редактора плана и поведение стен нулевой толщины не менялись