Reproduction steps:
1. Open the user-attached “UndetectedUxmlChanges.zip“ project
2. Open the “Assets” > “SerializedPropertyIssue” > “NewUXMLTemplate.uxml” file from the Project window (UI Builder window should open)
3. Click on the “Project” button under the Library of the UI Builder window
4. Drag the “Element” into the Hierarchy of the UI Builder window
5. Expand the “Attributes“ > “M_Container” > “M_value” > “M_value” in the Inspector of the UI Builder window
6. Type anything into the “Path” field
Expected result: No error is displayed in the Console
Actual result: “Assertion failed on expression: '!m_IsUndoing'“ error gets displayed in the Console
Reproducible with: 2023.3.0a6, 2023.3.0a11
Not reproducible with: 2023.2.0b14, 2023.3.0a5
Could not test with: 2021.3.31f1, 2022.3.11f1, 2023.1.17f1 (missing assembly references for UnityEngine.UIElements and UnityEditor.UIElements namespaces)
Reproduced on: Windows 11 Pro (22H2)
Not reproduced on: No other environment tested
Notes:
- Reproducible in a new project (with the same scripts as in the user-attached “UndetectedUxmlChanges.zip” project)
- After the error appears in the Console, it is possible to edit the “Path” field again and no new errors appear (2023.3.0a8 and newer)
- In 2023.3.0a6 and 2023.3.0a7 Unity Editor versions the error message is different (see below) and a new iteration of it appears with every letter typed into the “Path” field, and typing gets stopped every time (can only enter letters one by one by reselecting the “Path” field every time the error appears)
Full error message (2023.3.0a8 and newer):
Assertion failed on expression: '!m_IsUndoing'
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Unity.UI.Builder.BuilderUxmlAttributesView:ProcessBatchedChanges ()
UnityEngine.UIElements.UIEventRegistration:UpdateSchedulers ()
Unity.UI.Builder.BuilderUxmlAttributesView:OnUndoRedoPerformed ()
UnityEditor.Undo:Internal_CallUndoRedoPerformed ()
Unity.UI.Builder.BuilderUxmlAttributesView:ProcessBatchedChanges ()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Full error message (2023.3.0a6 and 2023.3.0a7):
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List{{1+Enumerator[T].MoveNextRare () (at <e83baa97766c48ccb8f12fd8854cf705>:0) System.Collections.Generic.List}}1+Enumerator[T].MoveNext () (at <e83baa97766c48ccb8f12fd8854cf705>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.UpdateTrackedProperties () (at <fc1aaba3017143eea21e9846e942faaa>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)