Fixes a corner-case bug where an exception is thrown when accessing an Action's bindings property after modifying a Composite binding. Although this scenario is covered by a test, the bug only occurs when the target action is contained by an ActionMap.
It's unclear exactly why an action in a Map is handled differently than one that isn't, due to the complex functionality of Adding/Updating bindings, and there might be other cases this issue (or something similar) can occur. However, I decided a simple, low-risk fix is preferable to a more fundamental change.
Changes made
Added an Action initializer when creating a new Binding within BindingSyntax.InsertPartBinding().
Added a new test to cover this scenario: Actions_CanChangeBindingPart_ToExistingCompositeInActionMap()
NOTE: The new test is nearly identical to the existing Actions_CanAddBindingsToActions_ToExistingComposite() test except the target action is added to an ActionMap.
Testing
Verified the bug fix, both manually with the customer's repro project and with the new test case.
Risk
Very low-risk change: worst case Action reference is null and we fallback to existing behavior.
Checklist
Before review:
[x] Changelog entry added.
Explains the change in Changed, Fixed, Added sections.
For API change contains an example snippet and/or migration example.
JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
Description
Fixes a corner-case bug where an exception is thrown when accessing an Action's bindings property after modifying a Composite binding. Although this scenario is covered by a test, the bug only occurs when the target action is contained by an ActionMap.
It's unclear exactly why an action in a Map is handled differently than one that isn't, due to the complex functionality of Adding/Updating bindings, and there might be other cases this issue (or something similar) can occur. However, I decided a simple, low-risk fix is preferable to a more fundamental change.
Changes made
Added an Action initializer when creating a new Binding within
BindingSyntax.InsertPartBinding()
. Added a new test to cover this scenario:Actions_CanChangeBindingPart_ToExistingCompositeInActionMap()
NOTE: The new test is nearly identical to the existing
Actions_CanAddBindingsToActions_ToExistingComposite()
test except the target action is added to an ActionMap.Testing
Verified the bug fix, both manually with the customer's repro project and with the new test case.
Risk
Very low-risk change: worst case Action reference is null and we fallback to existing behavior.
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: