mirror of
https://github.com/penpot/penpot.git
synced 2026-11-16 15:11:17 +00:00
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