Fix(designer): Adding an action in V3 could create a duplicate named action resulting in data loss. #4721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug Fix
What is the current behavior? (You can also link to an open issue here)
In short, if you were to create an action (example Scope) and change its name to a name that will be autogenerated (Scope 1) and then add another action of the same type, it will generate an action of the same name (Scope 1) instead of a unique one.
If the actions are in the same "branch" then an error will be thrown on save catching the duplicate names and informing the user the flow wasn't saved because of this. If you have the actions in parallel branches, then the flow will save successfully, but when the user reloads the flow one of the actions will override the other resulting in data loss for that action and potentially its children.
Link to bug: https://msazure.visualstudio.com/One/_workitems/edit/27685791/
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
N/A
Please Include Screenshots or Videos of the intended change:
Save Time (Current Behavior)
![image](https://private-user-images.githubusercontent.com/28818445/326058131-76c541bd-5fa8-4833-861a-3553223bc912.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTAxNjIsIm5iZiI6MTcxOTcwOTg2MiwicGF0aCI6Ii8yODgxODQ0NS8zMjYwNTgxMzEtNzZjNTQxYmQtNWZhOC00ODMzLTg2MWEtMzU1MzIyM2JjOTEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDAxMTEwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzMDNkOTg1NjA1YjBlMGVkOWNiMDNmMjYwYzAwMzM2ZjY4Y2ZmY2YwYWM2ZWRhZWYzMzRlZGE3M2IyYmFiNjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DP1_c6KsLTdYxliqBUF_EaJ5giAfBWZWN2S4__FKyrc)
Flow Reload (Current Behavior)
![image](https://private-user-images.githubusercontent.com/28818445/326058208-85557736-03e9-433c-a244-653474c1d682.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTAxNjIsIm5iZiI6MTcxOTcwOTg2MiwicGF0aCI6Ii8yODgxODQ0NS8zMjYwNTgyMDgtODU1NTc3MzYtMDNlOS00MzNjLWEyNDQtNjUzNDc0YzFkNjgyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDAxMTEwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjY2U5NzI0OTdjYmNiYTdjODc1ZjI4NzI4ZjkwOWJlOWU1NjYwOWE0ODExY2MwMGYwNmU4NWI5NjFjNWE1ODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kk-_diOjyh5Sehn-Ri4IVKUzt0tK1At9FeFMdg3HVCk)
Save Time (Bug Fix)
![image](https://private-user-images.githubusercontent.com/28818445/326056974-bafc8eff-9a26-432f-a79a-aa73fbbaeae7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTAxNjIsIm5iZiI6MTcxOTcwOTg2MiwicGF0aCI6Ii8yODgxODQ0NS8zMjYwNTY5NzQtYmFmYzhlZmYtOWEyNi00MzJmLWE3OWEtYWE3M2ZiYmFlYWU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDAxMTEwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdmMWI4MDYwOTVmODk0YTYzYTllMjBkZWVjMjAxZGY4ZDE1M2YwZDE2YTI3Y2VlYmMwZWNlMTk4NjllYzZjN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DUVD0dBOo5Vb6I73qiMlrrkgE6TKbUt6ai0FzMKWosQ)
Flow Reload (Bug Fix)
![image](https://private-user-images.githubusercontent.com/28818445/326056986-bea288ee-b5b8-434a-95f7-592dedccb831.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTAxNjIsIm5iZiI6MTcxOTcwOTg2MiwicGF0aCI6Ii8yODgxODQ0NS8zMjYwNTY5ODYtYmVhMjg4ZWUtYjViOC00MzRhLTk1ZjctNTkyZGVkY2NiODMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDAxMTEwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJlNzg2NTllMTY0NjQ4NTdhYTkxMDRjMmQ3OWE4MTNhYmFmZjJjZWU4YzYwNjdkMGNlYzY5YjVmMTlhYTlkZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kZ2sqfrcVNY8oNP7L8R66MPYdYg70CGjH1B8BdJ8I50)