Open nakedible opened 4 days ago
The fix pull runs now hooks after observers, but observers are run in the same order as on insertion, not in reverse order. Flecs says observer ordering is undefined, and I also think that having undefined ordering is better than saying observers are called in insertion order (or reverse insertion order). So I believe it's fine that the observers are not run in reverse order by this pull.
If guaranteed observer ordering is added (in a separate pull), then that pull should also add functionality to call the observers in reverse order, and this reverse order should be used for OnReplace
and OnRemove
observers.
Objective
Solution
on_replace
oron_remove
Testing
Migration Guide
The order of hooks and observers for
on_replace
andon_remove
has been swapped. Observers are now run before hooks. This is a more natural ordering where the removal ordering is inverted compared to the insertion ordering.