Run observers before hooks for on_replace and on_remove#16499
Run observers before hooks for on_replace and on_remove#16499alice-i-cecile merged 2 commits intobevyengine:mainfrom
on_replace and on_remove#16499Conversation
bushrat011899
left a comment
There was a problem hiding this comment.
This makes sense to me conceptually. Nice work!
|
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 |
|
@alice-i-cecile Two approving community reviews. Not certain of the process, but -S-Needs-Review +S-Ready-For-Final-Review? |
16dc842 to
72fc32b
Compare
|
The reason this failed the merge queue is exactly because my other pull added checks for the order of hooks vs. observers :-) the only fix needed is to fix the testcase, which is exactly correct. |
|
|
@alice-i-cecile Mind bumping this back into the merge queue? |
…ne#16499) # Objective - Fixes bevyengine#16498 ## Solution - Trivially swaps ordering of hooks and observers for all call sites where they are triggered for `on_replace` or `on_remove` ## Testing - Just CI --- ## Migration Guide The order of hooks and observers for `on_replace` and `on_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.
Objective
on_remove/on_replaceshould be inverted #16498Solution
on_replaceoron_removeTesting
Migration Guide
The order of hooks and observers for
on_replaceandon_removehas 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.