Horde crash/infinite loop when using multiple streams and workspace inheritance

StreamConfig.PostLoad has references to the workspaces and flattens the inheritance hierarchy in-place in the referenced workspaces. Post-merge, base and base_incremental both reference the same view list and when the second stream is loaded, the flatten process on workspaces is run a second time on the same workspaces which fails because ConfigObject.MergeDefaults does not properly handle the case of the base and flattened incremental_base referring to the same list instance. The bug is when merging using ConfigMergeStrategy.Append.

Our fix (UE 5.6.0) is to change Engine/Source/Programs/Horde/HordeServer.Shared/Configuration/ConfigObject.cs

[Content removed]7 @@ namespace HordeServer.Configuration
                                                {
                                                        propertyInfo.SetValue(target, sourceValue);
                                                }
-                       else if (sourceValue != null)
+                       else if (sourceValue != null && !ReferenceEquals(sourceValue, targetValue))
                                                {
                                                        IList sourceList = (IList)sourceValue;
                                                        IList targetList = 
(IList)targetValue;


Steps to Reproduce
If you have workspace types using inheritance with views such as:

 "base": {
     "view": ["foo"]
…
   },
   "base_incremental": {
     "identifier": "base_incremental",
     "base": "base"
…
   },

And then reference the base_incremental workspace in multiple streams, Horde will crash with an infinite loop.

Thanks for the detailed bug report, much appreciated!

I was able to reproduce it in a unit test and submitted your proposed fix. It’ll show up on GitHub within 3 hours.

Happy to help! Thanks for adding the test, too.