Eva Marco 755369276d
🐛 Fix stack overflow when applying a library update (#12661)
* 🐛 Fix stack overflow when applying a library update

Each shape updated by a component sync added its reg-objects undo change
with (update :undo-changes concat [...]). That wrapped the whole undo list
in one more lazy concat per shape, with the old list at the head. After a
few thousand shapes, walking the list overflowed the stack, which matches
the nested LazySeq frames reported when a library update is applied.

add-update-attr-changes now conjs the reg-objects before the mod-obj, so
undo restores each shape and then recalculates its parents, as redo does.

The trailing reg-objects also recalculated groups after undoing shapes
that the sync added or removed. To keep that, add-shape-to-instance,
add-shape-to-main and remove-shape now add their own undo reg-objects,
conjed before their other undo changes so it runs after them.

Tests cover many calls to add-update-attr-changes, a sync and undo of
many shapes, and undoing a sync that moves, adds or removes a child of a
group in the copy.

Closes #12576

AI-assisted-by: claude-opus-5-5

* 🐛 Test undo of an inverse sync that adds a shape

The previous commit added an undo :reg-objects to add-shape-to-main, so
undoing an "update main component" recalculates the main's groups after
removing the added shapes. No test covered it.

The new test adds a shape at the start of a group in the copy and changes
a sibling's fill, runs the inverse sync and undoes it. Without the undo
reg, the main group keeps the bounds of the removed shape.

AI-assisted-by: claude-opus-5-5
2026-10-29 18:09:46 +01:00
..
2026-09-22 10:22:31 +02:00
2026-09-29 09:07:34 +02:00
2026-10-29 15:43:06 +01:00
2026-10-29 15:43:06 +01:00
2026-03-11 15:24:40 +01:00