Placing lots of stacked notes, selecting them via timeline and deleting causes crash
Type
Crash to desktop
Bug description
While in the editor, if notes are stacked on the same timestamp many many times over, and then are highlighted through the timeline and deleted with the delete key, an unhandled error occurs and the program crashes.
Screenshots or videos
Unexpected crash: https://clips.twitch.tv/WiseCallousGrasshopperSwiftRage-t99DUOyxTkZOjgic Reproduced: https://clips.twitch.tv/BetterDifficultShrimpMoreCowbell-7oIe4D5C3I48Tif_
NOTE: There is an _ in the "Reproduced" URL that is not hyperlinked.
Version
osu! 2022.501.0-lazer
Logs
database.log network.log performance.log runtime.log updater.log
Log doesn't contain crash stack trace, but I reproduced independently and got this:
[runtime] 2022-05-03 17:39:25 [error]: System.InvalidOperationException: Can not change depth of drawable which is not contained within this CompositeDrawable.
[runtime] 2022-05-03 17:39:25 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.ChangeInternalChildDepth(Drawable child, Single newDepth)
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.Compose.Components.BlueprintContainer`1.OnBlueprintDeselected(SelectionBlueprint`1 blueprint) in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs:line 428
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.Compose.Components.EditorBlueprintContainer.OnBlueprintDeselected(SelectionBlueprint`1 blueprint) in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/Compose/Components/EditorBlueprintContainer.cs:line 147
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Rulesets.Edit.SelectionBlueprint`1.updateState() in /home/dachb/Dokumenty/opensource/osu/osu.Game/Rulesets/Edit/SelectionBlueprint.cs:line 81
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Rulesets.Edit.SelectionBlueprint`1.set_State(SelectionState value) in /home/dachb/Dokumenty/opensource/osu/osu.Game/Rulesets/Edit/SelectionBlueprint.cs:line 64
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Rulesets.Edit.SelectionBlueprint`1.Deselect() in /home/dachb/Dokumenty/opensource/osu/osu.Game/Rulesets/Edit/SelectionBlueprint.cs:line 115
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.Compose.Components.BlueprintContainer`1.RemoveBlueprintFor(T item) in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs:line 289
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.EditorBeatmap.UpdateState() in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/EditorBeatmap.cs:line 315
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.TransactionalCommitComponent.EndChange() in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/TransactionalCommitComponent.cs:line 53
[runtime] 2022-05-03 17:39:25 [error]: at osu.Game.Screens.Edit.EditorBeatmap.RemoveRange(IEnumerable`1 hitObjects) in /home/dachb/Dokumenty/opensource/osu/osu.Game/Screens/Edit/EditorBeatmap.cs:line 253
Marking as relatively low prio as you have to stack a lot to hit this.
Sentry issue: OSU-G3
This might be related to #20019
I did some testing and I found out that this is indeed related to #20019 and fixing that fixes this issue, but I also found the reason why this only occurs when selecting a big stack on the timeline. Selecting a big stack of objects like this on the timeline for some reason only selects half of the objects and it selects them in reverse order. This combination of selecting only half and in reverse order is what causes the issue when deleting.