mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-07 06:59:46 +00:00
fix(import): remap vacuum routes to copied space (#611)
Repair both incoming routes and safe target-reference recovery, with backend and mutation coverage for foreign and same-instance imports. Issue: #611 User-Visible: yes
This commit is contained in:
@@ -5620,6 +5620,30 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: '**({"plan_only": plan_only}),',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'space-import-keeps-incoming-vacuum-route-space',
|
||||
guard: 'node scripts/backend-test-guard.mjs issue_611_incoming_route_follows_fresh_space',
|
||||
because: 'a copied vacuum route must follow the fresh space id on both foreign and '
|
||||
+ 'same-instance imports instead of failing validation or silently targeting the source floor',
|
||||
patches: [{
|
||||
file: 'custom_components/houseplan/import_export.py',
|
||||
find: ' route["space"] = new_space_id\n'
|
||||
+ ' _report_remap(',
|
||||
replace: ' route["space"] = old_space_id # mutant: keep source floor\n'
|
||||
+ ' _report_remap(',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'space-import-keeps-target-vacuum-route-space',
|
||||
guard: 'node scripts/backend-test-guard.mjs issue_611_target_route_follows_safe_space_repair',
|
||||
because: 'the second-pass target repair must apply its proven exact/lineage space mapping to '
|
||||
+ 'vacuum routes as well as marker.space',
|
||||
patches: [{
|
||||
file: 'custom_components/houseplan/import_export.py',
|
||||
find: ' route["space"] = mapped\n',
|
||||
replace: ' route["space"] = route.get("space") # mutant: ignore mapping\n',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'plan-only-revalidate-flag-dropped',
|
||||
guard: 'node scripts/backend-test-guard.mjs plan_only_export_projects',
|
||||
|
||||
Reference in New Issue
Block a user