Andrey Antukh 64a51e86fd
🐛 Fix files blocked by dangling child references in migrations (#12936) (#12979)
The 0033-normalize-main-instance-names migration walks the shape tree
following the :shapes vectors. When a parent listed a child id missing
from the container :objects map (a dangling reference), the traversal
stored the nil child into :objects, creating a nil key that made
check-file-data reject the whole file: get-file answered 500 "invalid
file data" and the file could not be opened or migrated further.

Fix it in two parts:

- 0033 returns the container untouched when a listed child does not
  exist, so the traversal never stores a nil shape.
- The append-only migration 0035-fix-dangling-children prunes from
  every :shapes vector, in pages and components, the ids absent from
  the owning container :objects map, logging each fix at trace level.
  It mirrors 0032-fix-children-not-in-parent, which repairs the
  opposite inconsistency.

Both parts are needed: 0033 runs before the repair migration, so
without the guard the same file fails again in the same migrate call.

Add regression tests for the traversal guard and for the repair
migration, and record in mem:clojure/logging the convention that
:hints start lowercase.

Closes #12936

AI-assisted-by: qwen3.8-flash
2026-11-12 09:41:49 +01:00
..
2022-11-08 13:02:14 +01:00