Changed the routing on the rename actions to use hashedaccountId from the URL

--- src/SFA.DAS.EAS.Web/Controllers/EmployerAccountController.cs
+++ src/SFA.DAS.EAS.Web/Controllers/EmployerAccountController.cs
@@ -229,6 +229,7 @@
         }

         [HttpGet]
+        [Route("accounts/{HashedAccountId}/rename")]
         public async Task<ActionResult> RenameAccount(string hashedAccountId)
         {
             var userIdClaim = OwinWrapper.GetClaimValue(@"sub");
@@ -238,6 +239,7 @@

         [HttpPost]
         [ValidateAntiForgeryToken]
+        [Route("accounts/{HashedAccountId}/rename")]
         public async Task<ActionResult> RenameAccount(RenameEmployerAccountViewModel vm)
         {
             var userIdClaim = OwinWrapper.GetClaimValue(@"sub");
@@ -254,7 +256,7 @@

                 TempData["FlashMessage"] = JsonConvert.SerializeObject(flashmessage);

-                return RedirectToAction("Index", "Home");
+                return RedirectToAction("Index", "EmployerTeam");
             }

             var errorResponse = new OrchestratorResponse<RenameEmployerAccountViewModel>();


closed #775. Некорректный unboxing целых типов в маршаллере.

--- src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs
+++ src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs
@@ -60,14 +60,30 @@
             {
                 valueObj = value.AsString();
             }
-            else if (type == typeof(int) || type == typeof(short) || type == typeof(sbyte))
+            else if (type == typeof(int))
             {
                 valueObj = (int)value.AsNumber();
             }
-            else if (type == typeof(uint) || type == typeof(ushort) || type == typeof(byte))
+            else if (type == typeof(sbyte))
+            {
+                valueObj = (sbyte)value.AsNumber();
+            }
+            else if (type == typeof(short))
+            {
+                valueObj = (short)value.AsNumber();
+            }
+            else if (type == typeof(ushort))
+            {
+                valueObj = (ushort)value.AsNumber();
+            }
+            else if (type == typeof(uint))
             {
                 valueObj = (uint)value.AsNumber();
             }
+            else if (type == typeof(byte))
+            {
+                valueObj = (byte)value.AsNumber();
+            }
             else if (type == typeof(long))
             {
                 valueObj = (long)value.AsNumber();
@@ -76,7 +92,11 @@
             {
                 valueObj = (ulong)value.AsNumber();
             }
-            else if (type == typeof(double) || type == typeof(decimal))
+            else if (type == typeof(double))
+            {
+                valueObj = (double)value.AsNumber();
+            }
+            else if (type == typeof(decimal))
             {
                 valueObj = value.AsNumber();
             }


create dictionary

create dictionary

--- src/Serenity.Net.Data.Entity/Row/DefaultRowFieldsProvider.cs
+++ src/Serenity.Net.Data.Entity/Row/DefaultRowFieldsProvider.cs
@@ -12,6 +12,7 @@

         public DefaultRowFieldsProvider(IServiceProvider serviceProvider)
         {
+            this.byType = new ConcurrentDictionary<Type, RowFieldsBase>();
             this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
         }


Removed superfluous AsSelf() method call from model binder registrations.

--- src/Source/Autofac.Integration.Mvc/RegistrationExtensions.cs
+++ src/Source/Autofac.Integration.Mvc/RegistrationExtensions.cs
@@ -137,7 +137,6 @@
             return builder.RegisterAssemblyTypes(modelBinderAssemblies)
                 .Where(type => typeof(IModelBinder).IsAssignableFrom(type))
                 .As<IModelBinder>()
-                .AsSelf()
                 .InstancePerHttpRequest()
                 .WithMetadata(AutofacModelBinderProvider.MetadataKey, type =>
                     (from ModelBinderTypeAttribute attribute in type.GetCustomAttributes(typeof(ModelBinderTypeAttribute), true)


don't force IRangeValueProvider necessarily

--- src/UIA.Extensions/AutomationProviders/RangeValueProvider.cs
+++ src/UIA.Extensions/AutomationProviders/RangeValueProvider.cs
@@ -5,9 +5,15 @@

 namespace UIA.Extensions.AutomationProviders
 {
-    public interface RangeValueControl : IRangeValueProvider
+    public interface RangeValueControl
     {
         Control Control { get; }
+        double Value { get; set; }
+        bool IsReadOnly { get; }
+        double Maximum { get; }
+        double Minimum { get; }
+        double LargeChange { get; }
+        double SmallChange { get; }
     }

     public class RangeValueProvider : ControlProvider, IRangeValueProvider
@@ -26,7 +32,7 @@

         public void SetValue(double value)
         {
-            _rangeValue.SetValue(value);
+            _rangeValue.Value = value;
         }

         public double Value


More code changes. We parse specifically for a "200 OK" response.

--- src/UWPShoutcastMSS/Streaming/ShoutcastMediaSourceManager.cs
+++ src/UWPShoutcastMSS/Streaming/ShoutcastMediaSourceManager.cs
@@ -291,7 +291,7 @@
             //todo fire an event?
         }

-        private async Task EstablishConnectionAsync()
+        private async Task<Tuple<bool, KeyValuePair<string, string>[]>> EstablishConnectionAsync()
         {
             //http://www.smackfu.com/stuff/programming/shoutcast.html
             try
@@ -312,7 +312,7 @@
                 else
                     throw new Exception("Connection Error", ex);

-                return;
+                return null;
             }

             //todo figure out how to resolve http requests better to get rid of this hack.
@@ -347,43 +347,52 @@
                 response += socketReader.ReadString(1);
             }

-            if (response.StartsWith("HTTP/1.0 302") || response.StartsWith("HTTP/1.1 302"))
-            {
-                socketReader.Dispose();
-                socketWriter.Dispose();
-                socket.Dispose();
-
-                var parsedResponse = ParseHttpResponseToKeyPairArray(response.Split(new string[] { "\r\n" }, StringSplitOptions.None).Skip(1).ToArray());
-
-                socket = new StreamSocket();
-                streamUrl = new Uri(parsedResponse.First(x => x.Key.ToLower() == "location").Value);
-
-                await EstablishConnectionAsync();
-
-                return;
-            }
-            else if (response.StartsWith("HTTP/1.0 404"))
-            {
-                throw new Exception("Station is unavailable.");
-            }
-            else if (response.StartsWith("ICY 401")) //ICY 401 Service Unavailable
-            {
-                if (MediaStreamSource != null)
-                    MediaStreamSource.NotifyError(MediaStreamSourceErrorStatus.FailedToConnectToServer);
-                else
-                    throw new Exception("Station is unavailable at this time. Maybe they're down for maintainence?");
-
-                return;
-            }
-            else if (response.StartsWith("HTTP/1.1 503")) //HTTP/1.1 503 Server limit reached
-            {
-                throw new Exception("Station is unavailable at this time. The maximum amount of listeners has been reached.");
-            }
-
-            ParseResponse(response);
-        }
-
-        private void ParseResponse(string response)
+            if (response.StartsWith("HTTP/1.0 200 OK") || response.StartsWith("HTTP/1.1 200 OK") || response.StartsWith("ICY 200"))
+            {
+                var headers = ParseResponse(response);
+
+                return new Tuple<bool, KeyValuePair<string, string>[]>(connected, headers);
+            }
+            else
+            {
+                //wasn't successful. handle each case accordingly.
+
+                if (response.StartsWith("HTTP /1.0 302") || response.StartsWith("HTTP/1.1 302"))
+                {
+                    socketReader.Dispose();
+                    socketWriter.Dispose();
+                    socket.Dispose();
+
+                    var parsedResponse = ParseHttpResponseToKeyPairArray(response.Split(new string[] { "\r\n" }, StringSplitOptions.None).Skip(1).ToArray());
+
+                    socket = new StreamSocket();
+                    streamUrl = new Uri(parsedResponse.First(x => x.Key.ToLower() == "location").Value);
+
+                    return await EstablishConnectionAsync();
+                }
+                else if (response.StartsWith("HTTP/1.0 404"))
+                {
+                    throw new Exception("Station is unavailable.");
+                }
+                else if (response.StartsWith("ICY 401")) //ICY 401 Service Unavailable
+                {
+                    if (MediaStreamSource != null)
+                        MediaStreamSource.NotifyError(MediaStreamSourceErrorStatus.FailedToConnectToServer);
+                    else
+                        throw new Exception("Station is unavailable at this time. Maybe they're down for maintainence?");
+
+                    return new Tuple<bool, KeyValuePair<string, string>[]>(connected, null);
+                }
+                else if (response.StartsWith("HTTP/1.1 503")) //HTTP/1.1 503 Server limit reached
+                {
+                    throw new Exception("Station is unavailable at this time. The maximum amount of listeners has been reached.");
+                }
+            }
+
+            return new Tuple<bool, KeyValuePair<string, string>[]>(false, null); //not connected and no headers.
+        }
+
+        private KeyValuePair<string, string>[] ParseResponse(string response)
         {
             string[] responseSplitByLine = response.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
             KeyValuePair<string, string>[] headers = ParseHttpResponseToKeyPairArray(responseSplitByLine);
@@ -412,6 +421,10 @@
                     contentType = StreamAudioFormat.AAC_ADTS;
                     break;
             }
+
+
+
+            return headers;
         }

         private static KeyValuePair<string, string>[] ParseHttpResponseToKeyPairArray(string[] responseSplitByLine)


Promise for the changed unit test was incorrect, so correcting it in this commit

--- src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs
+++ src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs
@@ -61,7 +61,7 @@
 			Assert.AreEqual(mRoot.Id, publishedMedia.Id);
 			Assert.AreEqual(mRoot.CreateDateTime.ToString("dd/MM/yyyy HH:mm:ss"), publishedMedia.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"));
 			Assert.AreEqual(mRoot.User.Id, publishedMedia.CreatorId);
-			Assert.AreEqual(mRoot.User.LoginName, publishedMedia.CreatorName);
+			Assert.AreEqual(mRoot.User.Name, publishedMedia.CreatorName);
 			Assert.AreEqual(mRoot.ContentType.Alias, publishedMedia.DocumentTypeAlias);
 			Assert.AreEqual(mRoot.ContentType.Id, publishedMedia.DocumentTypeId);
 			Assert.AreEqual(mRoot.Level, publishedMedia.Level);


https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6587 - Build fix

--- src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
+++ src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
@@ -9,7 +9,6 @@
 using Umbraco.Core.Models;
 using Umbraco.Core.Services;
 using Umbraco.Web.BackOffice.Filters;
-using Umbraco.Web.BackOffice.Validation;
 using Umbraco.Web.Common.Attributes;
 using Umbraco.Web.Common.Exceptions;
 using Umbraco.Web.Editors;


Fix idle tracker not accounting global actions

--- osu.Game/Input/IdleTracker.cs
+++ osu.Game/Input/IdleTracker.cs
@@ -6,13 +6,14 @@
 using osu.Framework.Input;
 using osu.Framework.Input.Bindings;
 using osu.Framework.Input.Events;
+using osu.Game.Input.Bindings;

 namespace osu.Game.Input
 {
     /// <summary>
     /// Track whether the end-user is in an idle state, based on their last interaction with the game.
     /// </summary>
-    public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>, IHandleGlobalKeyboardInput
+    public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>, IKeyBindingHandler<GlobalAction>, IHandleGlobalKeyboardInput
     {
         private readonly double timeToIdle;

@@ -58,6 +59,10 @@

         public void OnReleased(PlatformAction action) => updateLastInteractionTime();

+        public bool OnPressed(GlobalAction action) => updateLastInteractionTime();
+
+        public void OnReleased(GlobalAction action) => updateLastInteractionTime();
+
         protected override bool Handle(UIEvent e)
         {
             switch (e)


Add all test cases from sdk-UnitUnderCoverage to ThrowWhenError

--- source/MlIB.Reply.Tests.Unit/Features/IReplyFast_ThrowWhenError.cs
+++ source/MlIB.Reply.Tests.Unit/Features/IReplyFast_ThrowWhenError.cs
@@ -9,6 +9,18 @@
         // UNIT UNDER TEST:
         // IReplyFast.ThrowWhenError(string msgPrefix = null)

+        //TODO: Reduce implicit parameters to lower complexity?
+        //This should be possible by breaking them down into
+        // smaller units specialized on exception configuration.
+        //Having to configure messages on the fly probably cuts
+        // the advantage of speed this library seeks to provide.
+        //So best approach would be an one-time configuration
+        // set globally with a default setting initialized.
+        //Should make sure different configs across assemblies
+        // don't conflict though.
+
+
+        #region [ WHEN HasError == false ]

         //I: HasError false, msgPrefix null
         //O:dont throw, do nothing
@@ -32,29 +44,86 @@
             Assert.IsFalse(result.HasError, "WHY HAS ERROR??");  //O:keeps showing no error
         }

-        //I: HasError false, msgPrefix valid
-        //O:dont throw, do nothing
-        //O:keeps showing no error
-        [TestMethod]
-        public void IReplyFast_ThrowWhenError_msgPrefix_valid_WHEN_HasError_false()
-        {
-            var result = M.Reply.NoError(5);
-
-            Exception assert = null;
-            try
-            {
-                result.ThrowWhenError("blabla");
-            }
-            catch (Exception ex)
-            {
-                assert = ex;
-            }
-
-
-            Assert.IsNull(assert, "WHY THROWING??");  //O:dont throw, do nothing
-            Assert.IsFalse(result.HasError);  //O:keeps showing no error
-        }
-
+        #region [ 36 IGNORED TESTS WHEN HasError == false ] //BECAUSE WE *KNOW* THE *CURRENT* CODE WON'T LET THEM HAPPEN
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_null
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_null
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_null
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_null
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_null_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_null_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_ok_WHEN_HasError_false_exception_ok_errorCode_ok_errorMsg_ok
+
+        #endregion
+
+        #endregion
+
+
+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_null
         //I: HasError true, msgPrefix null, exception null, errorCode null, errorMsg null
         //O:throw ReplyException
         //O:generic exception message
@@ -80,6 +149,7 @@
             //Assert.IsTrue(assert.Message.Contains("A DEFAULT ERROR WAS THROWN"), "WHY NOT EXPECTED MESSAGE??"); revoked for lower complexity
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_null
         //I: HasError true, msgPrefix null, exception null, errorCode ok, errorMsg null
         //O:throw ReplyException
         //O:generic exception message
@@ -104,6 +174,7 @@
             //Assert.IsTrue(assert.Message.Contains("CODE"), "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_ok
         //I: HasError true, msgPrefix null, exception null, errorCode ok, errorMsg ok
         //O:throw ReplyException
         //O:generic exception message
@@ -129,6 +200,7 @@
             Assert.IsTrue(assert.Message.Contains("CODE"), "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_ok
         //I: HasError true, msgPrefix null, exception null, errorCode null, errorMsg ok
         //O:throw ReplyException
         //O:error message in exception message
@@ -153,6 +225,7 @@
             Assert.IsTrue(assert.Message.Contains(Stubs.Common.MSG_ErrorFound), "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_null
         //I: HasError true, msgPrefix null, exception ok, errorCode null, errorMsg null
         //O:throw expected exception
         [TestMethod]
@@ -175,6 +248,7 @@
             Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_ok
         //I: HasError true, msgPrefix null, exception ok, errorCode null, errorMsg ok
         //O:throw ReplyException exception
         [TestMethod]
@@ -199,6 +273,7 @@
             Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_null
         //I: HasError true, msgPrefix null, exception ok, errorCode ok, errorMsg null
         //O:throw ReplyException
         [TestMethod][Ignore]
@@ -223,6 +298,7 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_ok
         //I: HasError true, msgPrefix null, exception ok, errorCode ok, errorMsg ok
         //O:throw ReplyException
         [TestMethod]
@@ -248,6 +324,7 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_null
         //I: HasError true, msgPrefix ok, exception null, errorCode null, errorMsg null
         //O:throw ReplyException
         //O:empty message
@@ -272,6 +349,7 @@
             Assert.AreEqual("[--]", assert.Message, "WHY NOT EMPTY MESSAGE??");
         }

+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_null
         //I: HasError true, msgPrefix ok, exception null, errorCode ok, errorMsg null
         //O:throw ReplyException
         //O:empty message
@@ -298,6 +376,7 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_ok
         //I: HasError true, msgPrefix ok, exception null, errorCode null, errorMsg ok
         //O:throw ReplyException
         //O:error message in exception message
@@ -322,6 +401,7 @@
             Assert.IsTrue(assert.Message.Contains(Stubs.Common.MSG_ErrorFound), "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_ok
         //I: HasError true, msgPrefix ok, exception null, errorCode ok, errorMsg ok
         //O:throw ReplyException
         //O:error message in exception message
@@ -348,6 +428,7 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_null
         //I: HasError true, msgPrefix ok, exception ok, errorCode null, errorMsg null
         //O:throw ReplyException
         [TestMethod]
@@ -371,6 +452,7 @@
             Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_ok
         //I: HasError true, msgPrefix ok, exception ok, errorCode null, errorMsg ok
         //O:throw ReplyException
         [TestMethod]
@@ -395,6 +477,7 @@
             Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_null
         //I: HasError true, msgPrefix ok, exception ok, errorCode ok, errorMsg null
         //O:throw ReplyException
         [TestMethod][Ignore]
@@ -418,6 +501,7 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }

+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_ok
         //I: HasError true, msgPrefix ok, exception ok, errorCode ok, errorMsg ok
         //O:throw ReplyException
         [TestMethod]
@@ -441,5 +525,50 @@
             //Assert.AreEqual(Stubs.Common.EXCEPTION, assert.InnerException, "WHY NOT EXPECTED INNER EXCEPTION??");
             //Assert.AreEqual(Stubs.Common.EXCEPTION.Message, assert.InnerException.Message, "WHY NOT EXPECTED MESSAGE??");
         }
+
+
+        #region [ IGNORED TESTS ] //BECAUSE WE DON'T *THINK* IT'S WORTH TESTING THIS MUCH
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_null
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_null
+
+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_null_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_ok_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_empty
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_null_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_null_errorCode_ok_errorMsg_ok
+
+        // _msgPrefix_empty_WHEN_HasError_true_exception_ok_errorCode_ok_errorMsg_ok
+
+        #endregion
     }
 }


minor

minor

--- src/biz.dfch.CS.Abiquo.Client.Tests/General/UriHelperTest.cs
+++ src/biz.dfch.CS.Abiquo.Client.Tests/General/UriHelperTest.cs
@@ -189,7 +189,7 @@
             var id = UriHelper.ExtractIdAsInt("https://example/api/users/155");

             // Assert
-            Assert.IsTrue(155 == id);
+            Assert.AreEqual(155, id);
         }

         [TestMethod]
@@ -217,7 +217,7 @@
         }

         [TestMethod]
-        public void ExtractLastSegmentAsStringWithValidUriSucceeds()
+        public void ExtractLastSegmentAsStringWithValidUriStringSucceeds()
         {
             // Arrange

@@ -225,7 +225,7 @@
             var lastSegment = UriHelper.ExtractLastSegmentAsString("https://example/api/users/fe5ddc9e-7745-4a4a-99d6-d7598682f8fd");

             // Assert
-            Assert.IsTrue("fe5ddc9e-7745-4a4a-99d6-d7598682f8fd" == lastSegment);
+            Assert.AreEqual("fe5ddc9e-7745-4a4a-99d6-d7598682f8fd", lastSegment);
         }
     }
 }


0.1.50 non beta

0.1.50 non beta

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -1,5 +1,5 @@
 using System.Reflection;

-[assembly: AssemblyVersion("0.1.41")]
-[assembly: AssemblyFileVersion("0.1.41")]
-[assembly: AssemblyInformationalVersion("0.1.41-beta")]+[assembly: AssemblyVersion("0.1.50")]
+[assembly: AssemblyFileVersion("0.1.50")]
+[assembly: AssemblyInformationalVersion("0.1.50")]


New release 1.3.1

New release 1.3.1

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -29,5 +29,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.3.0.0")]
-[assembly: AssemblyFileVersion("1.3.0.0")]
+[assembly: AssemblyVersion("1.3.1.0")]
+[assembly: AssemblyFileVersion("1.3.1.0")]


New internal version 1.0.28.

New internal version 1.0.28.

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -11,5 +11,5 @@

 [assembly: ComVisible(false)]

-[assembly: AssemblyVersion("1.0.27.0")]
-[assembly: AssemblyFileVersion("1.0.27.0")]
+[assembly: AssemblyVersion("1.0.28.0")]
+[assembly: AssemblyFileVersion("1.0.28.0")]


Update TopicRepositoryExtensions.cs

Update TopicRepositoryExtensions.cs

--- yafsrc/YAF.Core/Model/TopicRepositoryExtensions.cs
+++ yafsrc/YAF.Core/Model/TopicRepositoryExtensions.cs
@@ -184,7 +184,7 @@
         }

         /// <summary>
-        /// The unanswered as data table.
+        /// Returns topics which have no replies.
         /// </summary>
         /// <param name="repository">
         /// The repository.
@@ -208,7 +208,7 @@
         /// Indicates if the Table should contain the last Access Date
         /// </param>
         /// <returns>
-        /// Returns the List with the Topics Unanswered
+        /// Returns the List with the Topics
         /// </returns>
         public static List<PagedTopic> ListUnansweredPaged(
             this IRepository<Topic> repository,
@@ -232,7 +232,7 @@
         }

         /// <summary>
-        /// Returns Topics Unread by a user
+        /// Lists the Active Topics
         /// </summary>
         /// <param name="repository">
         /// The repository.
@@ -256,7 +256,7 @@
         /// Indicates if the Table should contain the last Access Date
         /// </param>
         /// <returns>
-        /// Returns the List with the Topics Unread be a PageUserId
+        /// Returns the the Active Topics
         /// </returns>
         public static List<PagedTopic> ListActivePaged(
             this IRepository<Topic> repository,
@@ -279,13 +279,13 @@
         }

         /// <summary>
-        /// Returns Topics Unread by a user
-        /// </summary>
-        /// <param name="repository">
-        /// The repository.
-        /// </param>
-        /// <param name="pageUserId">
-        /// The page user id.
+        /// List all Topics Watched by a user
+        /// </summary>
+        /// <param name="repository">
+        /// The repository.
+        /// </param>
+        /// <param name="userId">
+        /// The user id.
         /// </param>
         /// <param name="sinceDate">
         /// The since Date.
@@ -303,11 +303,11 @@
         /// Indicates if the Table should contain the last Access Date
         /// </param>
         /// <returns>
-        /// Returns the List with the Topics Unread be a PageUserId
-        /// </returns>
-        public static List<PagedTopic> ListUnreadPaged(
-            this IRepository<Topic> repository,
-            [NotNull] int pageUserId,
+        /// Returns the List with the Topics Watched by a user
+        /// </returns>
+        public static List<PagedTopic> ListWatchedPaged(
+            this IRepository<Topic> repository,
+            [NotNull] int userId,
             [NotNull] DateTime sinceDate,
             [NotNull] DateTime toDate,
             [NotNull] int pageIndex,
@@ -316,13 +316,134 @@
         {
             CodeContracts.VerifyNotNull(repository);

-            return repository.ListPaged(
-                pageUserId,
-                pageIndex,
-                pageSize,
-                findLastRead,
-                (t, x, c) => x.UserID == pageUserId && x.ReadAccess &&
-                             (t.Flags & 8) != 8 && t.TopicMovedID == null && t.LastPosted != null && t.LastPosted > sinceDate && t.LastPosted < toDate);
+            Expression<Func<Topic, bool>> whereCriteria = t =>
+                (t.Flags & 8) != 8 && t.TopicMovedID == null && t.LastPosted != null && t.LastPosted > sinceDate
+                && t.LastPosted < toDate;
+
+            var expression = OrmLiteConfig.DialectProvider.SqlExpression<WatchTopic>();
+
+            return repository.DbAccess.Execute(
+                db =>
+                {
+                    expression.Join<User>((t, u) => u.ID == t.UserID)
+                        .Join<Topic>((a, b) => b.ID == a.TopicID).Join<Topic, Forum>((t, f) => f.ID == t.ForumID)
+                        .Where<WatchTopic>(b => b.UserID == userId);
+
+                    expression.Where(whereCriteria);
+
+                    // -- count total
+                    var countTotalExpression = db.Connection.From<Topic>().Join<Forum>((t, f) => f.ID == t.ForumID)
+                        .Join<Forum, ActiveAccess>((f, x) => x.ForumID == f.ID)
+                        .Join<Forum, Category>((f, c) => c.ID == f.CategoryID);
+
+                    countTotalExpression.Where(whereCriteria);
+
+                    expression.OrderByDescending<Topic>(t => t.LastPosted).Page(pageIndex + 1, pageSize);
+
+                    var countTotalSql = countTotalExpression
+                        .Select(Sql.Count($"{countTotalExpression.Column<Topic>(x => x.ID)}")).ToSelectStatement();
+
+                    // -- count deleted posts
+                    var countDeletedExpression = db.Connection.From<Message>(db.Connection.TableAlias("mes"));
+                    countDeletedExpression.Where(
+                        $@"mes.{countDeletedExpression.Column<Message>(x => x.TopicID)}={expression.Column<Topic>(x => x.ID, true)}
+                                    and (mes.{countDeletedExpression.Column<Message>(x => x.Flags)} & 8) = 8
+                                    and mes.{countDeletedExpression.Column<Message>(x => x.UserID)}={userId}");
+                    var countDeletedSql = countDeletedExpression.Select(Sql.Count("1")).ToSelectStatement();
+
+                    var lastTopicAccessSql = "NULL";
+                    var lastForumAccessSql = "NULL";
+
+                    if (findLastRead)
+                    {
+                        var topicAccessExpression =
+                            db.Connection.From<TopicReadTracking>(db.Connection.TableAlias("y"));
+                        topicAccessExpression.Where(
+                            $@"y.{topicAccessExpression.Column<TopicReadTracking>(y => y.TopicID)}={expression.Column<Topic>(x => x.ID, true)}
+                                    and y.{topicAccessExpression.Column<TopicReadTracking>(y => y.UserID)}={userId}");
+                        lastTopicAccessSql = topicAccessExpression.Select(
+                                $"{topicAccessExpression.Column<TopicReadTracking>(x => x.LastAccessDate)}").Limit(1)
+                            .ToSelectStatement();
+
+                        var forumAccessExpression =
+                            db.Connection.From<ForumReadTracking>(db.Connection.TableAlias("x"));
+                        forumAccessExpression.Where(
+                            $@"x.{forumAccessExpression.Column<ForumReadTracking>(x => x.ForumID)}={expression.Column<Topic>(x => x.ForumID, true)}
+                                    and x.{forumAccessExpression.Column<ForumReadTracking>(x => x.UserID)}={userId}");
+                        lastForumAccessSql = forumAccessExpression.Select(
+                                $"{forumAccessExpression.Column<ForumReadTracking>(x => x.LastAccessDate)}").Limit(1)
+                            .ToSelectStatement();
+                    }
+
+                    // -- last user
+                    var lastUserNameExpression = db.Connection.From<User>(db.Connection.TableAlias("usr"));
+                    lastUserNameExpression.Where(
+                        $@"usr.{lastUserNameExpression.Column<User>(x => x.ID)}=
+                                   {expression.Column<Topic>(x => x.LastUserID, true)}");
+                    var lastUserNameSql = lastUserNameExpression.Select(
+                        $"{lastUserNameExpression.Column<User>(x => x.Name)}").Limit(1).ToSelectStatement();
+
+                    var lastUserDisplayNameSql = lastUserNameExpression.Select(
+                        $"{lastUserNameExpression.Column<User>(x => x.DisplayName)}").Limit(1).ToSelectStatement();
+
+                    var lastUserSuspendedSql = lastUserNameExpression.Select(
+                        $"{lastUserNameExpression.Column<User>(x => x.Suspended)}").Limit(1).ToSelectStatement();
+
+                    var lastUserStyleSql = lastUserNameExpression.Select(
+                        $"{lastUserNameExpression.Column<User>(x => x.UserStyle)}").Limit(1).ToSelectStatement();
+
+                    // -- first message
+                    var firstMessageExpression = db.Connection.From<Message>(db.Connection.TableAlias("fm"));
+                    firstMessageExpression.Where(
+                        $@"fm.{firstMessageExpression.Column<Message>(x => x.TopicID)}=
+                                   {OrmLiteConfig.DialectProvider.IsNullFunction(expression.Column<Topic>(x => x.TopicMovedID, true), expression.Column<Topic>(x => x.ID, true))}
+                                   and fm.{firstMessageExpression.Column<Message>(x => x.Position)} = 0");
+                    var firstMessageSql = firstMessageExpression.Select(
+                        $"{firstMessageExpression.Column<Message>(x => x.MessageText)}").Limit(1).ToSelectStatement();
+
+                    expression.Select<Topic, User, Forum>(
+                        (c, b, d) => new
+                        {
+                            ForumID = d.ID,
+                            TopicID = c.ID,
+                            c.Posted,
+                            LinkTopicID = c.TopicMovedID != null ? c.TopicMovedID : c.ID,
+                            c.TopicMovedID,
+                            Subject = c.TopicName,
+                            c.Description,
+                            c.Status,
+                            c.Styles,
+                            c.UserID,
+                            Starter = c.UserName != null ? c.UserName : b.Name,
+                            StarterDisplay = c.UserDisplayName != null ? c.UserDisplayName : b.DisplayName,
+                            Replies = c.NumPosts - 1,
+                            NumPostsDeleted = Sql.Custom($"({countDeletedSql})"),
+                            c.Views,
+                            c.LastPosted,
+                            c.LastUserID,
+                            LastUserName = Sql.Custom($"({lastUserNameSql})"),
+                            LastUserDisplayName = Sql.Custom($"({lastUserDisplayNameSql})"),
+                            LastUserSuspended = Sql.Custom($"({lastUserSuspendedSql})"),
+                            LastUserStyle = Sql.Custom($"({lastUserStyleSql})"),
+                            c.LastMessageFlags,
+                            c.LastMessageID,
+                            LastTopicID = c.ID,
+                            c.LinkDate,
+                            TopicFlags = c.Flags,
+                            c.Priority,
+                            c.PollID,
+                            ForumFlags = d.Flags,
+                            FirstMessage = Sql.Custom($"({firstMessageSql})"),
+                            StarterStyle = b.UserStyle,
+                            StarterSuspended = b.Suspended,
+                            LastForumAccess = Sql.Custom($"({lastForumAccessSql})"),
+                            LastTopicAccess = Sql.Custom($"({lastTopicAccessSql})"),
+                            c.TopicImage,
+                            TotalRows = Sql.Custom($"({countTotalSql})")
+                        });
+
+                    return db.Connection.Select<PagedTopic>(expression);
+                });
         }

         /// <summary>


Added itself to profiler ignores

Added itself to profiler ignores

--- src/AutoTest.TestRunner/AutoTest.TestRunners.Shared/TestProcess.cs
+++ src/AutoTest.TestRunner/AutoTest.TestRunners.Shared/TestProcess.cs
@@ -96,7 +96,9 @@
                 _proc.StartInfo.EnvironmentVariables.Add("MMProfiler_LogFilename", _profilerLogFile);

 				if (_profileExcludes != null)
-					_proc.StartInfo.EnvironmentVariables.Add("MMProfiler_Excludes", _profileExcludes);
+					_proc.StartInfo.EnvironmentVariables.Add("MMProfiler_Excludes", "AutoTest.TestRunners, " + _profileExcludes);
+                else
+                    _proc.StartInfo.EnvironmentVariables.Add("MMProfiler_Excludes", "AutoTest.TestRunners");
                 _proc.StartInfo.EnvironmentVariables.Add("MMProfiler_Runtime", string.Format(".NET{0}", _targetedRun.TargetFramework.Major));
 			}
             _proc.Start();


Added additional checks in ChangeNotificationWrapper to prevent cast exceptions

--- src/Catel.Core/Catel.Core.Shared/Data/ChangeNotificationWrapper.cs
+++ src/Catel.Core/Catel.Core.Shared/Data/ChangeNotificationWrapper.cs
@@ -12,9 +12,11 @@
     using System.Collections.Generic;
     using System.Collections.Specialized;
     using System.ComponentModel;
+    using System.Linq;
     using System.Runtime.CompilerServices;
     using System.Windows;
     using Catel.Logging;
+    using Reflection;
     using IWeakEventListener = Catel.IWeakEventListener;

     /// <summary>
@@ -171,7 +173,15 @@
             // Reset requires our own logic
             if (e.Action == NotifyCollectionChangedAction.Reset)
             {
-                UpdateCollectionSubscriptions((IEnumerable)sender);
+                var enumerable = sender as IEnumerable;
+                if (enumerable != null)
+                {
+                    UpdateCollectionSubscriptions(enumerable);
+                }
+                else
+                {
+                    Log.Warning("Received NotifyCollectionChangedAction.Reset for '{0}', but the type does implement IEnumerable", sender.GetType().GetSafeFullName());
+                }
             }

             if (e.NewItems != null)
@@ -242,7 +252,8 @@
                     List<WeakReference> collectionItems;
                     if (_collectionItems.TryGetValue(collection, out collectionItems))
                     {
-                        foreach (var item in collectionItems)
+                        var oldItems = collectionItems.ToArray();
+                        foreach (var item in oldItems)
                         {
                             if (item.IsAlive)
                             {
@@ -253,7 +264,8 @@

                         collectionItems.Clear();

-                        foreach (var item in collection)
+                        var newItems = collection.Cast<object>().ToArray();
+                        foreach (var item in newItems)
                         {
                             SubscribeNotifyChangedEvents(item, true);
                         }


Changed HttpClient to static to try to fix leaking connections

--- ffmpeg-farm-client/Worker/ApiWrapper.cs
+++ ffmpeg-farm-client/Worker/ApiWrapper.cs
@@ -17,13 +17,12 @@

         private readonly StatusClient _statusClient;
         private readonly TaskClient _taskClient;
-        private readonly HttpClient _httpClient;
+        private static readonly HttpClient HttpClient = new HttpClient{Timeout = TimeSpan.FromSeconds(10)};

         public ApiWrapper(string apiUri, ILogger logger, CancellationToken ct)
         {
-            _httpClient = new HttpClient {Timeout = TimeSpan.FromSeconds(10) };
-            _taskClient = new TaskClient(_httpClient) { BaseUrl = apiUri};
-            _statusClient = new StatusClient(_httpClient) { BaseUrl = apiUri };
+            _taskClient = new TaskClient(HttpClient) { BaseUrl = apiUri};
+            _statusClient = new StatusClient(HttpClient) { BaseUrl = apiUri };
             _logger = logger;
             _cancellationToken = ct;
         }
@@ -31,7 +30,6 @@
         ~ApiWrapper()
         {
             _logger.Debug("Disposing ApiWrapper");
-            _httpClient?.Dispose();
         }

         public FFmpegTaskDto GetNext(string machineName)


Basic implementation of diagnostic

Basic implementation of diagnostic

--- src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzers.cs
+++ src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzers.cs
@@ -4,6 +4,7 @@
 using System.Text;
 using Microsoft.CodeAnalysis.CodeQuality;
 using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Operations;

 namespace Microsoft.CodeAnalysis.CSharp.MakeStructFieldsWritable
 {
@@ -30,7 +31,45 @@

         protected override void InitializeWorker(AnalysisContext context)
         {
-            throw new NotImplementedException();
+            context.RegisterCompilationStartAction(compilationStartContext
+                => CompilationAnalyzer.CreateAndRegisterActions(compilationStartContext));
+        }
+
+        private sealed class CompilationAnalyzer
+        {
+            private bool _hasNonReadonlyFields = false;
+            private bool _hasTypeInstanceAssigment = false;
+
+            public static void CreateAndRegisterActions(CompilationStartAnalysisContext compilationStartContext)
+            {
+                var compilationAnalyzer = new CompilationAnalyzer();
+                compilationAnalyzer.RegisterActions(compilationStartContext);
+            }
+
+            private void RegisterActions(CompilationStartAnalysisContext context)
+            {
+                context.RegisterSymbolStartAction(symbolStartContext =>
+                {
+                    var namedTypeSymbol = (INamedTypeSymbol)symbolStartContext.Symbol;
+                    if (namedTypeSymbol.TypeKind != TypeKind.Struct) return;
+
+                    symbolStartContext.RegisterSyntaxNodeAction(AnalyzeIfFieldIsReadonly, SymbolKind.Field);
+                    symbolStartContext.RegisterOperationAction(AnalyzeAssignment, OperationKind.SimpleAssignment);
+                }, SymbolKind.NamedType);
+            }
+
+            private void AnalyzeAssignment(OperationAnalysisContext operationContext)
+            {
+                var operationAssigmnent = (IAssignmentOperation)operationContext.Operation;
+                _hasTypeInstanceAssigment = operationAssigmnent.Target is IInstanceReferenceOperation instance &&
+                                            instance.ReferenceKind == InstanceReferenceKind.ContainingTypeInstance;
+            }
+
+            private void AnalyzeIfFieldIsReadonly(SyntaxNodeAnalysisContext nodeContext)
+            {
+                var fieldSymbol = (IFieldSymbol)nodeContext.ContainingSymbol;
+                _hasNonReadonlyFields |= fieldSymbol.IsReadOnly;
+            }
         }
     }
 }


fixed integration test not matching its name

--- src/tests/IntegrationTests/Memory/SafeString/SafeStringTests.cs
+++ src/tests/IntegrationTests/Memory/SafeString/SafeStringTests.cs
@@ -50,7 +50,7 @@
             var sut1 = new SafeString();
             sut1.Append("hej");
             var sut2 = new SafeString();
-            sut2.Append("sup");
+            sut2.Append("sp");
             // act
             var equality = sut1.Equals(sut2);
             var equalityOpposite = sut2.Equals(sut1);


Implemented Ban User Handler.

Implemented Ban User Handler.

--- src/Server/ChatterBox.ChatServer/Handlers/BanUserCommandHandler.cs
+++ src/Server/ChatterBox.ChatServer/Handlers/BanUserCommandHandler.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Threading.Tasks;
 using ChatterBox.Core.Persistence;
+using ChatterBox.Domain.Aggregates.UserAggregate;
 using ChatterBox.MessageContracts.Commands;

 namespace ChatterBox.ChatServer.Handlers
@@ -11,9 +12,15 @@
         {
         }

-        public override Task Execute(IUnitOfWork context, BanUserCommand command)
+        public override async Task Execute(IUnitOfWork context, BanUserCommand command)
         {
-            throw new NotImplementedException();
+            var repository = context.Repository<User>();
+
+            var user = repository.GetById(command.BanUserId);
+
+            user.ChangeUserRole(UserRole.Banned);
+
+            context.Complete();
         }
     }
 }


Set ShutdownTimeout in Kestrel tests (#25743)

--- src/Servers/Kestrel/shared/test/TransportTestHelpers/TestServer.cs
+++ src/Servers/Kestrel/shared/test/TransportTestHelpers/TestServer.cs
@@ -101,6 +101,13 @@
                         .UseSetting(WebHostDefaults.ShutdownTimeoutKey, TestConstants.DefaultTimeout.TotalSeconds.ToString())
                         .Configure(app => { app.Run(_app); });
                 })
+                .ConfigureServices(services =>
+                {
+                    services.Configure<HostOptions>(option =>
+                    {
+                        option.ShutdownTimeout = TestConstants.DefaultTimeout;
+                    });
+                })
                 .Build();

             _host.Start();


missing IsNull in NullableBooleanWrapper

--- src/Sooda/QL/TypedWrappers/SoqlNullableBooleanWrapperExpression.cs
+++ src/Sooda/QL/TypedWrappers/SoqlNullableBooleanWrapperExpression.cs
@@ -33,5 +33,7 @@
     {
         public SoqlNullableBooleanWrapperExpression() { }
         public SoqlNullableBooleanWrapperExpression(SoqlExpression innerExpression) : base(innerExpression) { }
+        public SoqlBooleanExpression IsNull() { return new SoqlBooleanIsNullExpression(this, false); }
+        public SoqlBooleanExpression IsNotNull() { return new SoqlBooleanIsNullExpression(this, true); }
     }
 }


Fixed issue #209: generated factories produce TypeAccessException under Silverlight. Calling Expression.Constant() with a Type parameter generates code referencing RuntimeType.

--- src/Source/Autofac/Features/GeneratedFactories/FactoryGenerator.cs
+++ src/Source/Autofac/Features/GeneratedFactories/FactoryGenerator.cs
@@ -57,7 +57,7 @@
                     // c, service, [new Parameter(name, (object)dps)]*
                     var resolveParams = new[] {
                             activatorContextParam,
-                            Expression.Constant(service),
+                            Expression.Constant(service, typeof(Service)),
                             Expression.NewArrayInit(typeof(Parameter), resolveParameterArray)
                         };

@@ -86,7 +86,7 @@
                 {
                     // productRegistration, [new Parameter(name, (object)dps)]*
                     var resolveParams = new Expression[] {
-                        Expression.Constant(productRegistration),
+                        Expression.Constant(productRegistration, typeof(IComponentRegistration)),
                         Expression.NewArrayInit(typeof(Parameter), resolveParameterArray)
                     };

@@ -124,7 +124,7 @@
                 .Select(pi => Expression.Parameter(pi.ParameterType, pi.Name))
                 .ToList();

-            Expression[] resolveParameterArray = MapParameters(creatorParams, pm);
+            var resolveParameterArray = MapParameters(creatorParams, pm);

             var resolveCall = makeResolveCall(activatorContextParam, resolveParameterArray);

@@ -148,7 +148,7 @@
                     return creatorParams
                             .Select(p => Expression.New(
                                 typeof(TypedParameter).GetConstructor(new[] { typeof(Type), typeof(object) }),
-                                Expression.Constant(p.Type), Expression.Convert(p, typeof(object))))
+                                Expression.Constant(p.Type, typeof(Type)), Expression.Convert(p, typeof(object))))
                             .OfType<Expression>()
                             .ToArray();

@@ -156,7 +156,7 @@
                     return creatorParams
                         .Select((p, i) => Expression.New(
                                 typeof(PositionalParameter).GetConstructor(new[] { typeof(int), typeof(object) }),
-                                Expression.Constant(i), Expression.Convert(p, typeof(object))))
+                                Expression.Constant(i, typeof(int)), Expression.Convert(p, typeof(object))))
                             .OfType<Expression>()
                             .ToArray();

@@ -167,7 +167,7 @@
                     return creatorParams
                             .Select(p => Expression.New(
                                 typeof(NamedParameter).GetConstructor(new[] { typeof(string), typeof(object) }),
-                                Expression.Constant(p.Name), Expression.Convert(p, typeof(object))))
+                                Expression.Constant(p.Name, typeof(string)), Expression.Convert(p, typeof(object))))
                             .OfType<Expression>()
                             .ToArray();
             }


CountyDetailsView - try to fix data controls rendering issues

--- src/StatisticsRomania/StatisticsRomania/Views/CountyDetailsView.cs
+++ src/StatisticsRomania/StatisticsRomania/Views/CountyDetailsView.cs
@@ -154,7 +154,7 @@
             }
         }

-        protected async override void OnSizeAllocated(double width, double height)
+        protected override void OnSizeAllocated(double width, double height)
         {
             base.OnSizeAllocated(width, height);

@@ -171,9 +171,10 @@
             }
             else
             {
+                dataControls.Orientation = StackOrientation.Horizontal;
                 plotView.HeightRequest = -1;
                 plotView.WidthRequest = width / 2;
-                dataControls.Orientation = StackOrientation.Horizontal;
+                degChapterData.ForceLayout();
             }
         }


Address PR feedback

Address PR feedback

--- src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs
+++ src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs
@@ -957,22 +957,24 @@
         [Fact]
         public async Task SendAsync_RequestVersion10_ServerReceivesVersion10Request()
         {
-            Version responseVersion = await SendRequestAndGetResponseVersionAsync(new Version(1, 0), null);
-            Assert.Equal(new Version(1, 0), responseVersion);
+            Version receivedRequestVersion = await SendRequestAndGetRequestVersionAsync(new Version(1, 0));
+            Assert.Equal(new Version(1, 0), receivedRequestVersion);
         }

         [Fact]
         public async Task SendAsync_RequestVersion11_ServerReceivesVersion11Request()
         {
-            Version responseVersion = await SendRequestAndGetResponseVersionAsync(new Version(1, 1), null);
-            Assert.Equal(new Version(1, 1), responseVersion);
+            Version receivedRequestVersion = await SendRequestAndGetRequestVersionAsync(new Version(1, 1));
+            Assert.Equal(new Version(1, 1), receivedRequestVersion);
         }

         [Fact]
         public async Task SendAsync_RequestVersionNotSpecified_ServerReceivesVersion11Request()
         {
-            Version responseVersion = await SendRequestAndGetResponseVersionAsync(null, null);
-            Assert.Equal(new Version(1, 1), responseVersion);
+            // The default value for HttpRequestMessage.Version is Version(1,1).
+            // So, we need to set something different (0,0), to test the "unknown" version.
+            Version receivedRequestVersion = await SendRequestAndGetRequestVersionAsync(new Version(0,0));
+            Assert.Equal(new Version(1, 1), receivedRequestVersion);
         }

         [Theory, MemberData(nameof(Http2Servers))]
@@ -980,70 +982,65 @@
         {
             // We don't currently have a good way to test whether HTTP/2 is supported without
             // using the same mechanism we're trying to test, so for now we allow both 2.0 and 1.1 responses.
-            Version responseVersion = await SendRequestAndGetResponseVersionAsync(new Version(2, 0), server);
-            Assert.True(
-                responseVersion == new Version(2, 0) ||
-                responseVersion == new Version(1, 1),
-                "Response version " + responseVersion);
-        }
-
-        private async Task<Version> SendRequestAndGetResponseVersionAsync(Version requestVersion, Uri serverUri)
-        {
-            Version responseVersion = null;
-
-            if (requestVersion == null)
-            {
-                // The default value for HttpRequestMessage.Version is Version(1,1).
-                // So, we need to set something different to test the "unknown" version.
-                requestVersion = new Version(0,0);
-            }
-            _output.WriteLine("Request version: {0}", requestVersion);
-
-            if (serverUri == null)
-            {
-                await LoopbackServer.CreateClientAndServerAsync(async (handler, client, server, url) =>
-                {
-                    var request = new HttpRequestMessage(HttpMethod.Get, url);
-                    request.Version = requestVersion;
-
-                    Task<HttpResponseMessage> getResponse = client.SendAsync(request);
-
-                    await LoopbackServer.AcceptSocketAsync(server, async (s, stream, reader, writer) =>
+            var request = new HttpRequestMessage(HttpMethod.Get, server);
+            request.Version = new Version(2, 0);
+
+            using (var client = new HttpClient())
+            using (HttpResponseMessage response = await client.SendAsync(request))
+            {
+                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+                Assert.True(
+                    response.Version == new Version(2, 0) ||
+                    response.Version == new Version(1, 1),
+                    "Response version " + response.Version);
+            }
+        }
+
+        private async Task<Version> SendRequestAndGetRequestVersionAsync(Version requestVersion)
+        {
+            Version receivedRequestVersion = null;
+
+            await LoopbackServer.CreateClientAndServerAsync(async (handler, client, server, url) =>
+            {
+                var request = new HttpRequestMessage(HttpMethod.Get, url);
+                request.Version = requestVersion;
+
+                Task<HttpResponseMessage> getResponse = client.SendAsync(request);
+
+                await LoopbackServer.AcceptSocketAsync(server, async (s, stream, reader, writer) =>
+                {
+                    string statusLine = reader.ReadLine();
+                    while (!string.IsNullOrEmpty(reader.ReadLine())) ;
+
+                    if (statusLine.Contains("/1.0"))
                     {
-                        // Server will echo back same minor HTTP/1.x version as request.
-                        string version = (request.Version == new Version(1,0)) ? "1.0" : "1.1";
-
-                        while (!string.IsNullOrEmpty(reader.ReadLine())) ;
-                        await writer.WriteAsync(
-                            $"HTTP/{version} 200 OK\r\n" +
-                            $"Date: {DateTimeOffset.UtcNow:R}\r\n" +
-                            "Content-Length: 0\r\n" +
-                            "\r\n");
-                        await writer.FlushAsync();
-                        s.Shutdown(SocketShutdown.Send);
-                    });
-
-                    using (HttpResponseMessage response = await getResponse)
+                        receivedRequestVersion = new Version(1,0);
+                    }
+                    else if (statusLine.Contains("/1.1"))
                     {
-                        Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-                        responseVersion = response.Version;
+                        receivedRequestVersion = new Version(1,1);
                     }
+                    else
+                    {
+                        Assert.True(false, "Invalid HTTP request version");
+                    }
+
+                    await writer.WriteAsync(
+                        $"HTTP/1.1 200 OK\r\n" +
+                        $"Date: {DateTimeOffset.UtcNow:R}\r\n" +
+                        "Content-Length: 0\r\n" +
+                        "\r\n");
+                    await writer.FlushAsync();
+                    s.Shutdown(SocketShutdown.Send);
                 });
-            }
-            else
-            {
-                var request = new HttpRequestMessage(HttpMethod.Get, serverUri);
-                request.Version = requestVersion;
-
-                using (var client = new HttpClient())
-                using (HttpResponseMessage response = await client.SendAsync(request))
-                {
-                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-                    responseVersion = response.Version;
-                }
-            }
-
-            return responseVersion;
+
+                using (HttpResponseMessage response = await getResponse)
+                {
+                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+                }
+            });
+
+            return receivedRequestVersion;
         }
         #endregion


[SharpDX] Deactivate code Ray.GetPickRay as it is using a non accessible struct

--- Source/SharpDX/Ray.cs
+++ Source/SharpDX/Ray.cs
@@ -259,29 +259,29 @@
             return Collision.RayIntersectsSphere(ref this, ref sphere, out point);
         }

-        /// <summary>
-        /// Calculates a world space <see cref="SharpDX.Ray"/> from 2d screen coordinates.
-        /// </summary>
-        /// <param name="x">X coordinate on 2d screen.</param>
-        /// <param name="y">Y coordinate on 2d screen.</param>
-        /// <param name="viewport"><see cref="SharpDX.Direct3D11.Viewport"/>.</param>
-        /// <param name="worldViewProjection">Transformation <see cref="SharpDX.Matrix"/>.</param>
-        /// <returns>Resulting <see cref="SharpDX.Ray"/>.</returns>
-        public static Ray GetPickRay(int x, int y, Viewport viewport, Matrix worldViewProjection)
-        {
-            var nearPoint = new Vector3(x, y, 0);
-            var farPoint = new Vector3(x, y, 1);
+        ///// <summary>
+        ///// Calculates a world space <see cref="SharpDX.Ray"/> from 2d screen coordinates.
+        ///// </summary>
+        ///// <param name="x">X coordinate on 2d screen.</param>
+        ///// <param name="y">Y coordinate on 2d screen.</param>
+        ///// <param name="viewport"><see cref="SharpDX.Direct3D11.Viewport"/>.</param>
+        ///// <param name="worldViewProjection">Transformation <see cref="SharpDX.Matrix"/>.</param>
+        ///// <returns>Resulting <see cref="SharpDX.Ray"/>.</returns>
+        //public static Ray GetPickRay(int x, int y, Viewport viewport, Matrix worldViewProjection)
+        //{
+        //    var nearPoint = new Vector3(x, y, 0);
+        //    var farPoint = new Vector3(x, y, 1);

-            nearPoint = Vector3.Unproject(nearPoint, viewport.TopLeftX, viewport.TopLeftY, viewport.Width, viewport.Height, viewport.MinDepth,
-                                        viewport.MaxDepth, worldViewProjection);
-            farPoint = Vector3.Unproject(farPoint, viewport.TopLeftX, viewport.TopLeftY, viewport.Width, viewport.Height, viewport.MinDepth,
-                                        viewport.MaxDepth, worldViewProjection);
-
-            Vector3 direction = farPoint - nearPoint;
-            direction.Normalize();
-
-            return new Ray(nearPoint, direction);
-        }
+        //    nearPoint = Vector3.Unproject(nearPoint, viewport.TopLeftX, viewport.TopLeftY, viewport.Width, viewport.Height, viewport.MinDepth,
+        //                                viewport.MaxDepth, worldViewProjection);
+        //    farPoint = Vector3.Unproject(farPoint, viewport.TopLeftX, viewport.TopLeftY, viewport.Width, viewport.Height, viewport.MinDepth,
+        //                                viewport.MaxDepth, worldViewProjection);
+
+        //    Vector3 direction = farPoint - nearPoint;
+        //    direction.Normalize();
+
+        //    return new Ray(nearPoint, direction);
+        //}

         /// <summary>
         /// Tests for equality between two objects.


Preparing for dotnet remove PR

Preparing for dotnet remove PR

--- src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs
+++ src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs
@@ -1,12 +1,6 @@
 // Copyright (c) .NET Foundation and contributors. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.

-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Text;
 using Microsoft.Build.Evaluation;
 using Microsoft.DotNet.Cli;
 using Microsoft.DotNet.Cli.CommandLine;
@@ -15,6 +9,12 @@
 using Microsoft.DotNet.Tools.MSBuild;
 using Microsoft.DotNet.Tools.NuGet;
 using NuGet.Frameworks;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;

 namespace Microsoft.DotNet.Tools.Remove.PackageReference
 {
@@ -55,7 +55,8 @@
                 projectFilePath = fileOrDirectory;
             }

-            var result = NuGetCommand.Run(TransformArgs(RemainingArguments.First(), projectFilePath));
+            var packageToRemove = RemainingArguments.First();
+            var result = NuGetCommand.Run(TransformArgs(packageToRemove, projectFilePath));

             return result;
         }


Simplifying configuration property access

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.ProjectPropertyStorage.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.ProjectPropertyStorage.cs
@@ -1,11 +1,9 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

 using System;
-using System.Linq;
 using EnvDTE;
 using Microsoft.VisualStudio.Shell;
 using Microsoft.VisualStudio.Shell.Interop;
-using Roslyn.Utilities;

 namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
 {
@@ -49,7 +47,7 @@
                 {
                     foreach (Configuration configuration in configurationManager)
                     {
-                        configuration.Properties.Cast<Property>().First(property => property.Name == configurationPropertyName).Value = value;
+                        configuration.Properties.Item(configurationPropertyName).Value = value;
                     }
                 }
             }


Control doesn't need to implement INotifyPropertyChanged, but rather needed to take advantage of the existing implementation for dependency properties.

--- cslacs/Csla/Wpf/ObjectStatusPanel.cs
+++ cslacs/Csla/Wpf/ObjectStatusPanel.cs
@@ -29,30 +29,8 @@
   /// that supports WFP data binding against those
   /// values.
   /// </remarks>
-  public class ObjectStatusPanel : DataPanelBase, INotifyPropertyChanged
+  public class ObjectStatusPanel : DataPanelBase
   {
-    #region INotifyPropertyChanged
-
-    /// <summary>
-    /// Event indicating that an object property has changed.
-    /// </summary>
-    public event PropertyChangedEventHandler PropertyChanged;
-
-    /// <summary>
-    /// Raise the PropertyChanged event.
-    /// </summary>
-    /// <param name="name">Name of the property that has changed.</param>
-    protected void OnPropertyChanged(string name)
-    {
-      PropertyChangedEventHandler handler = PropertyChanged;
-      if (handler != null)
-      {
-        handler(this, new PropertyChangedEventArgs(name));
-      }
-    }
-
-    #endregion
-
     #region Dependency Properties

     private static readonly DependencyProperty IsDeletedProperty =
@@ -73,7 +51,13 @@
     public bool IsDeleted
     {
       get { return (bool)base.GetValue(IsDeletedProperty); }
-      set { base.SetValue(IsDeletedProperty, value); }
+      set
+      {
+        bool old = IsDeleted;
+        base.SetValue(IsDeletedProperty, value);
+        OnPropertyChanged(
+          new DependencyPropertyChangedEventArgs(IsDeletedProperty, old, value));
+      }
     }

     /// <summary>
@@ -83,7 +67,14 @@
     public bool IsDirty
     {
       get { return (bool)base.GetValue(IsDirtyProperty); }
-      set { base.SetValue(IsDirtyProperty, value); }
+      set
+      {
+        bool old = IsDirty;
+        base.SetValue(IsDirtyProperty, value);
+        if (old != value)
+          OnPropertyChanged(
+            new DependencyPropertyChangedEventArgs(IsDirtyProperty, old, value));
+      }
     }

     /// <summary>
@@ -93,7 +84,14 @@
     public bool IsNew
     {
       get { return (bool)base.GetValue(IsNewProperty); }
-      set { base.SetValue(IsNewProperty, value); }
+      set
+      {
+        bool old = IsNew;
+        base.SetValue(IsNewProperty, value);
+        if (old != value)
+          OnPropertyChanged(
+            new DependencyPropertyChangedEventArgs(IsNewProperty, old, value));
+      }
     }

     /// <summary>
@@ -103,7 +101,14 @@
     public bool IsSavable
     {
       get { return (bool)base.GetValue(IsSavableProperty); }
-      set { base.SetValue(IsSavableProperty, value); }
+      set
+      {
+        bool old = IsSavable;
+        base.SetValue(IsSavableProperty, value);
+        if (old != value)
+          OnPropertyChanged(
+            new DependencyPropertyChangedEventArgs(IsSavableProperty, old, value));
+      }
     }

     /// <summary>
@@ -113,7 +118,14 @@
     public bool IsValid
     {
       get { return (bool)base.GetValue(IsValidProperty); }
-      set { base.SetValue(IsValidProperty, value); }
+      set
+      {
+        bool old = IsValid;
+        base.SetValue(IsValidProperty, value);
+        if (old != value)
+          OnPropertyChanged(
+            new DependencyPropertyChangedEventArgs(IsValidProperty, old, value));
+      }
     }

     #endregion
@@ -171,30 +183,15 @@
       if (source != null)
       {
         if (IsDeleted != source.IsDeleted)
-        {
           IsDeleted = source.IsDeleted;
-          OnPropertyChanged("IsDeleted");
-        }
         if (IsDirty != source.IsDirty)
-        {
           IsDirty = source.IsDirty;
-          OnPropertyChanged("IsDirty");
-        }
         if (IsNew != source.IsNew)
-        {
           IsNew = source.IsNew;
-          OnPropertyChanged("IsNew");
-        }
         if (IsSavable != source.IsSavable)
-        {
           IsSavable = source.IsSavable;
-          OnPropertyChanged("IsSavable");
-        }
         if (IsValid != source.IsValid)
-        {
           IsValid = source.IsValid;
-          OnPropertyChanged("IsValid");
-        }
       }
       else
       {
@@ -202,20 +199,11 @@
         if (sourceList != null)
         {
           if (IsDirty != sourceList.IsDirty)
-          {
             IsDirty = sourceList.IsDirty;
-            OnPropertyChanged("IsDirty");
-          }
           if (IsValid != sourceList.IsValid)
-          {
             IsValid = sourceList.IsValid;
-            OnPropertyChanged("IsValid");
-          }
           if (IsSavable != sourceList.IsSavable)
-          {
             IsSavable = sourceList.IsSavable;
-            OnPropertyChanged("IsSavable");
-          }
           IsDeleted = false;
           IsNew = false;
         }


Try and catch everything while creating a part in PartMaker.

Also, consider the possibility of unequal module nodes and modules counts.
And of modules that add other modules (like CC does).

--- Addons/PartMaker.cs
+++ Addons/PartMaker.cs
@@ -4,6 +4,7 @@
 //       Allis Tauri <allista@gmail.com>
 //
 //  Copyright (c) 2018 Allis Tauri
+using System;
 using UnityEngine;

 namespace AT_Utils
@@ -23,7 +24,7 @@

         public static Part CreatePart(AvailablePart part_info, string flag_url)
         {
-            var part = Object.Instantiate(part_info.partPrefab);
+            var part = UnityEngine.Object.Instantiate(part_info.partPrefab);
             part.gameObject.SetActive(true);
             part.partInfo = part_info;
             part.name = part_info.name;
@@ -39,10 +40,20 @@
             part.orgPos = part.transform.root.InverseTransformPoint(part.transform.position);
             part.orgRot = Quaternion.Inverse(part.transform.root.rotation) * part.transform.rotation;
             part.packed = true;
-            //initialize modules
-            part.InitializeModules();
+            // initialize modules
+            try { part.InitializeModules(); }
+            catch(Exception e)
+            {
+                Utils.Log("Error while initializing modules of {}: {}\n{}",
+                          part, e.Message, e.StackTrace);
+            }
+            //load modules
             var module_nodes = part_info.partConfig.GetNodes("MODULE");
-            for(int i = 0, maxLength = module_nodes.Length; i < maxLength; i++)
+            for(int i = 0,
+                numNodes = module_nodes.Length,
+                numModules = part.Modules.Count;
+                i < numNodes && i < numModules;
+                i++)
             {
                 var node = module_nodes[i];
                 var module_name = node.GetValue("name");
@@ -50,11 +61,28 @@
                 {
                     var module = part.Modules[i];
                     if(module != null && module.ClassName == module_name)
-                        module.Load(node);
+                    {
+                        try { module.Load(node); }
+                        catch(Exception e)
+                        {
+                            Utils.Log("Unable to load {}: {}\n{}",
+                                      module, e.Message, e.StackTrace);
+                        }
+                    }
                 }
             }
-            foreach(var module in part.Modules)
-                module.OnStart(PartModule.StartState.PreLaunch);
+            // start modules
+            var m = 0;
+            while(m < part.Modules.Count)
+            {
+                var module = part.Modules[m++];
+                try { module.OnStart(PartModule.StartState.None); }
+                catch(Exception e)
+                {
+                    Utils.Log("Error in OnStart of {}: {}\n{}",
+                              module, e.Message, e.StackTrace);
+                }
+            }
             return part;
         }


Do a jitter for services discovery re-try

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -822,9 +822,8 @@
             }
             else
             {
-                // Log error and retry in 10 seconds
                 Debug.Log(request.error);
-                yield return new WaitForSeconds(10);
+                yield return new WaitForSeconds(UnityEngine.Random.Range(5.0f, 15.0f));
                 StartCoroutine(servicesDiscoveryCoroutine());
             }
         }


Adding this. to accesor

Adding this. to accesor

--- Auth0.Net/Client.cs
+++ Auth0.Net/Client.cs
@@ -1148,7 +1148,7 @@
             var request = new RestRequest(new Uri(url));
             request.AddHeader("accept", "application/json");

-            var response = client.Execute(request);
+            var response = this.client.Execute(request);
             return BuildPage<T>(response);
         }


Moved lazy cache removal to the central place for user id cache clearing.

--- yafsrc/YetAnotherForum.NET/controls/EditUsersProfile.ascx.cs
+++ yafsrc/YetAnotherForum.NET/controls/EditUsersProfile.ascx.cs
@@ -346,9 +346,6 @@
       // clear the cache for this user...
       UserMembershipHelper.ClearCacheForUserId(this.CurrentUserID);

-      // Clearing cache with old Active User Lazy Data ...
-      this.PageContext.Cache.Remove(YafCache.GetBoardCacheKey(Constants.Cache.ActiveUserLazyData.FormatWith(this.CurrentUserID)));
-
       if (!this.AdminEditMode)
       {
         YafBuildLink.Redirect(ForumPages.cp_profile);


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/ChunkedRequestStream.cs
+++ websocket-sharp/Net/ChunkedRequestStream.cs
@@ -120,17 +120,26 @@
       byte[] buffer, int offset, int count, AsyncCallback callback, object state
     )
     {
-      if (_disposed)
-        throw new ObjectDisposedException (GetType ().ToString ());
+      if (_disposed) {
+        var name = GetType ().ToString ();
+
+        throw new ObjectDisposedException (name);
+      }

       if (buffer == null)
         throw new ArgumentNullException ("buffer");

-      if (offset < 0)
-        throw new ArgumentOutOfRangeException ("offset", "A negative value.");
-
-      if (count < 0)
-        throw new ArgumentOutOfRangeException ("count", "A negative value.");
+      if (offset < 0) {
+        var msg = "A negative value.";
+
+        throw new ArgumentOutOfRangeException ("offset", msg);
+      }
+
+      if (count < 0) {
+        var msg = "A negative value.";
+
+        throw new ArgumentOutOfRangeException ("count", msg);
+      }

       var len = buffer.Length;


[Modify] Throw an exception

[Modify] Throw an exception

--- websocket-sharp/Net/HttpListenerResponse.cs
+++ websocket-sharp/Net/HttpListenerResponse.cs
@@ -568,6 +568,11 @@
         if (_disposed)
           throw new ObjectDisposedException (GetType ().ToString ());

+        if (_headersSent) {
+          var msg = "The response is already being sent.";
+          throw new InvalidOperationException (msg);
+        }
+
         if (value == null) {
           _location = null;
           return;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpListenerResponse.cs
+++ websocket-sharp/Net/HttpListenerResponse.cs
@@ -622,8 +622,10 @@
           return;
         }

-        if (value.Length == 0)
-          throw new ArgumentException ("An empty string.", "value");
+        if (value.Length == 0) {
+          var msg = "An empty string.";
+          throw new ArgumentException (msg, "value");
+        }

         Uri uri;
         if (!Uri.TryCreate (value, UriKind.Absolute, out uri))


Fix: Possible delay or deadlock when shutting down Playnite externally

--- source/Playnite/PipeServer.cs
+++ source/Playnite/PipeServer.cs
@@ -46,18 +46,31 @@
     [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
     public class PipeService : IPipeService
     {
+        private readonly SynchronizationContext syncContext;
         public event CommandExecutedEventHandler CommandExecuted;
+
+        public PipeService()
+        {
+            syncContext = SynchronizationContext.Current;
+        }

         public void InvokeCommand(CmdlineCommand command, string args)
         {
-            CommandExecuted?.Invoke(this, new CommandExecutedEventArgs(command, args));
+            // We don't want to block this call because it causes issues if some sync operation that shuts down server is also called.
+            // For example, mode switch or instance shutdown calls are stopping server,
+            // which results in serviceHost.Close() timeout, since server would be still waiting for InvokeCommand to finish.
+            Task.Run(async () =>
+            {
+                await Task.Delay(100);
+                syncContext.Post(_ => CommandExecuted?.Invoke(this, new CommandExecutedEventArgs(command, args)), null);
+            });
         }
     }

     public class PipeServer
     {
         private string endpoint;
-        ServiceHost serviceHost;
+        private ServiceHost serviceHost;

         public PipeServer(string endpoint)
         {


Red for rolling spare test

Red for rolling spare test

--- Bowling/bowling.csx
+++ Bowling/bowling.csx
@@ -32,7 +32,18 @@
 	public void All_one_pin_rolls()
 	{
 		RollMany(rolls: 20, pins: 1);
+
 		game.Score().ShouldBe(20);
+	}
+
+	public void Roll_one_spare()
+	{
+		game.Roll(5);
+		game.Roll(5); //spare
+		game.Roll(3);
+		RollMany(rolls: 17, pins: 0);
+
+		game.Score().ShouldBe(16);
 	}

 	private void RollMany(int rolls, int pins)


Reorganise code for clarity

Reorganise code for clarity

--- osu.Framework.Desktop/Input/Handlers/Mouse/OpenTKMouseHandler.cs
+++ osu.Framework.Desktop/Input/Handlers/Mouse/OpenTKMouseHandler.cs
@@ -34,20 +34,12 @@
                 lastState = state;

                 Point point = host.Window.PointToClient(new Point(state.X, state.Y));
-
                 Vector2 pos = new Vector2(point.X, point.Y);

-                if (host.Window.Focused)
-                {
-                    PendingStates.Enqueue(new InputState { Mouse = new TkMouseState(state, pos, host.IsActive) });
-                }
-                else
-                {
-                    // While not focused, let's silently ignore everything but position.
-                    PendingStates.Enqueue(
-                        new InputState { Mouse = new TkMouseState(new OpenTK.Input.MouseState(), pos, host.IsActive) }
-                    );
-                }
+                // While not focused, let's silently ignore everything but position.
+                if (host.Window.Focused) state = new OpenTK.Input.MouseState();
+
+                PendingStates.Enqueue(new InputState { Mouse = new TkMouseState(state, pos, host.IsActive) });

                 FrameStatistics.Increment(StatisticsCounterType.MouseEvents);
             }, 0, 0));


fix access to modified closures

fix access to modified closures

Co-Authored-By: smoogipoo <c9bd76907373126dff70d71f8b944159a669cbf1@smgi.me>

--- osu.Framework.Tests/Visual/UserInterface/TestSceneScreenStack.cs
+++ osu.Framework.Tests/Visual/UserInterface/TestSceneScreenStack.cs
@@ -703,13 +703,15 @@
         {
             TestScreen screen1 = null;

-            pushAndEnsureCurrent(() => screen1 = new TestScreen(id: 1)
-            {
-                Exiting = () =>
+            pushAndEnsureCurrent(() =>
+            {
+                screen1 = new TestScreen(id: 1);
+                screen1.Exiting = () =>
                 {
                     screen1.Push(new TestScreen(id: 2));
                     return true;
-                }
+                };
+                return screen1;
             });

             AddStep("Exit screen 1", () => screen1.Exit());


New primes, fix spelling,

New primes, fix spelling,

--- CSharp/FastNoise.cs
+++ CSharp/FastNoise.cs
@@ -33,7 +33,7 @@
 public class FastNoise
 {
     public enum NoiseType { Value, ValueCubic, Perlin, Simplex, OpenSimplex2f, Cellular, WhiteNoise };
-    public enum FractalType { None, FBm, Billow, Rigded, DomainWarpProgressive, DomainWarpIndependant };
+    public enum FractalType { None, FBm, Billow, Rigded, DomainWarpProgressive, DomainWarpIndependent };
     public enum CellularDistanceFunction { Euclidean, EuclideanSq, Manhattan, Natural };
     public enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div };
     public enum DomainWarpType { Gradient, Simplex };
@@ -234,9 +234,9 @@
     }

     // Hashing
-    private const int PrimeX = 0x165667b1;
-    private const int PrimeY = 0x45d9f3b;
-    private const int PrimeZ = 6971;
+    private const int PrimeX = 501125321;
+    private const int PrimeY = 1136930381;
+    private const int PrimeZ = 1720413743;

     private static int Hash(int seed, int xPrimed, int yPrimed)
     {
@@ -260,7 +260,8 @@
     {
         int hash = seed ^ xPrimed ^ yPrimed;

-        hash *= hash * 0x27d4eb2d;
+        hash *= 0x27d4eb2d;
+        hash ^= hash << 19;
         return hash / 2147483648.0f;
     }

@@ -268,7 +269,8 @@
     {
         int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed;

-        hash *= hash * 0x27d4eb2d;
+        hash *= 0x27d4eb2d;
+        hash ^= hash << 19;
         return hash / 2147483648.0f;
     }

@@ -496,7 +498,12 @@

     // White Noise
-    private int FloatCast2Int(FNfloat f)
+    private int FloatCast2Int(float f)
+    {
+        return BitConverter.SingleToInt32Bits(f);
+    }
+
+    private int FloatCast2Int(double f)
     {
         var i = BitConverter.DoubleToInt64Bits(f);

@@ -824,8 +831,8 @@
         int y0 = y1 - PrimeY;
         int x2 = x1 + PrimeX;
         int y2 = y1 + PrimeY;
-        int x3 = x1 + PrimeX * 2;
-        int y3 = y1 + PrimeY * 2;
+        int x3 = x1 + unchecked(PrimeX * 2);
+        int y3 = y1 + unchecked(PrimeY * 2);

         return CubicLerp(
             CubicLerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), ValCoord(seed, x2, y0), ValCoord(seed, x3, y0),
@@ -859,9 +866,9 @@
         int x2 = x1 + PrimeX;
         int y2 = y1 + PrimeY;
         int z2 = z1 + PrimeZ;
-        int x3 = x1 + PrimeX * 2;
-        int y3 = y1 + PrimeY * 2;
-        int z3 = z1 + PrimeZ * 2;
+        int x3 = x1 + unchecked(PrimeX * 2);
+        int y3 = y1 + unchecked(PrimeY * 2);
+        int z3 = z1 + unchecked(PrimeZ * 2);

         return CubicLerp(
@@ -1183,8 +1190,8 @@
             case FractalType.DomainWarpProgressive:
                 DomainWarpFractalProgressive(ref x, ref y);
                 break;
-            case FractalType.DomainWarpIndependant:
-                DomainWarpFractalIndependant(ref x, ref y);
+            case FractalType.DomainWarpIndependent:
+                DomainWarpFractalIndependent(ref x, ref y);
                 break;
         }
     }
@@ -1199,8 +1206,8 @@
             case FractalType.DomainWarpProgressive:
                 DomainWarpFractalProgressive(ref x, ref y, ref z);
                 break;
-            case FractalType.DomainWarpIndependant:
-                DomainWarpFractalIndependant(ref x, ref y, ref z);
+            case FractalType.DomainWarpIndependent:
+                DomainWarpFractalIndependent(ref x, ref y, ref z);
                 break;
         }
     }
@@ -1238,35 +1245,36 @@
         float amp = mDomainWarpAmp * mFractalBounding;
         float freq = mFrequency;

-        DoSingleDomainWarp(seed, amp, freq, x, y, ref x, ref y);
-
-        for (int i = 1; i < mOctaves; i++)
-        {
+        for (int i = 0; i < mOctaves; i++)
+        {
+            DoSingleDomainWarp(seed, amp, freq, x, y, ref x, ref y);
+
+            seed++;
+            amp *= mGain;
             freq *= mLacunarity;
-            amp *= mGain;
-            DoSingleDomainWarp(++seed, amp, freq, x, y, ref x, ref y);
-        }
-    }
+        }
+    }
+
     private void DomainWarpFractalProgressive(ref FNfloat x, ref FNfloat y, ref FNfloat z)
     {
         int seed = mSeed;
         float amp = mDomainWarpAmp * mFractalBounding;
         float freq = mFrequency;

-        DoSingleDomainWarp(seed, amp, freq, x, y, z, ref x, ref y, ref z);
-
-        for (int i = 1; i < mOctaves; i++)
-        {
+        for (int i = 0; i < mOctaves; i++)
+        {
+            DoSingleDomainWarp(seed, amp, freq, x, y, z, ref x, ref y, ref z);
+
+            seed++;
+            amp *= mGain;
             freq *= mLacunarity;
-            amp *= mGain;
-            DoSingleDomainWarp(++seed, amp, freq, x, y, z, ref x, ref y, ref z);
         }
     }

     // Domain Warp Fractal Independant

-    private void DomainWarpFractalIndependant(ref FNfloat x, ref FNfloat y)
+    private void DomainWarpFractalIndependent(ref FNfloat x, ref FNfloat y)
     {
         FNfloat xs = x;
         FNfloat ys = y;
@@ -1275,16 +1283,17 @@
         float amp = mDomainWarpAmp * mFractalBounding;
         float freq = mFrequency;

-        DoSingleDomainWarp(seed, amp, freq, xs, ys, ref x, ref y);
-
-        for (int i = 1; i < mOctaves; i++)
-        {
+        for (int i = 0; i < mOctaves; i++)
+        {
+            DoSingleDomainWarp(seed, amp, freq, xs, ys, ref x, ref y);
+
+            seed++;
+            amp *= mGain;
             freq *= mLacunarity;
-            amp *= mGain;
-            DoSingleDomainWarp(++seed, amp, freq, xs, ys, ref x, ref y);
-        }
-    }
-    private void DomainWarpFractalIndependant(ref FNfloat x, ref FNfloat y, ref FNfloat z)
+        }
+    }
+
+    private void DomainWarpFractalIndependent(ref FNfloat x, ref FNfloat y, ref FNfloat z)
     {
         FNfloat xs = x;
         FNfloat ys = y;
@@ -1294,13 +1303,13 @@
         float amp = mDomainWarpAmp * mFractalBounding;
         float freq = mFrequency;

-        DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, ref x, ref y, ref z);
-
-        for (int i = 1; i < mOctaves; i++)
-        {
+        for (int i = 0; i < mOctaves; i++)
+        {
+            DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, ref x, ref y, ref z);
+
+            seed++;
+            amp *= mGain;
             freq *= mLacunarity;
-            amp *= mGain;
-            DoSingleDomainWarp(++seed, amp, freq, xs, ys, zs, ref x, ref y, ref z);
         }
     }


Remove line that shouldn't have been added yet

--- osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs
+++ osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs
@@ -18,8 +18,6 @@
         {
             this.container = container;
         }
-
-        protected override bool AtImportantFrame => CurrentFrame.MouseX != PreviousFrame.MouseX;

         private ManiaPlayfield playfield;
         public override List<InputState> GetPendingStates()


SDK change to support up coming Custom Game Server Changes.

Summary: SDK change to support up coming Custom Game Server Changes.

Test Plan: Ask Marco

Reviewers: PGilmore

Reviewed By: PGilmore

Maniphest Tasks: T3513

Differential Revision: https://phabricator.playfab.com/D4863

--- targets/unity-v2/source/Shared/SignalR.NET20/Http/HttpHelper.cs
+++ targets/unity-v2/source/Shared/SignalR.NET20/Http/HttpHelper.cs
@@ -1,8 +1,10 @@
-#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API
+#if ENABLE_PLAYFABPLAYSTREAM_API && ENABLE_PLAYFABSERVER_API
 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using SignalR.Client._20.Transports;
 using SignalR.Infrastructure;
@@ -110,6 +112,7 @@
         public static EventSignal<CallbackDetail<HttpWebResponse>> GetAsync(string url, Action<HttpWebRequest> requestPreparer)
         {
             var _request = (HttpWebRequest)HttpWebRequest.Create(url);
+            ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback;
             if (requestPreparer != null)
             {
                 requestPreparer(_request);
@@ -117,6 +120,34 @@
             var signal = new EventSignal<CallbackDetail<HttpWebResponse>>();
             GetResponseAsync(_request, signal);
             return signal;
+        }
+
+        private static bool MyRemoteCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
+        {
+            bool isOk = true;
+            // If there are errors in the certificate chain,
+            // look at each error to determine the cause.
+            if (sslPolicyErrors != SslPolicyErrors.None)
+            {
+                for (int i = 0; i < chain.ChainStatus.Length; i++)
+                {
+                    if (chain.ChainStatus[i].Status == X509ChainStatusFlags.RevocationStatusUnknown)
+                    {
+                        continue;
+                    }
+                    chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
+                    chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
+                    chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0);
+                    chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags;
+                    bool chainIsValid = chain.Build((X509Certificate2)certificate);
+                    if (!chainIsValid)
+                    {
+                        isOk = false;
+                        break;
+                    }
+                }
+            }
+            return isOk;
         }

         public static void GetResponseAsync(HttpWebRequest request, EventSignal<CallbackDetail<HttpWebResponse>> signal)
@@ -168,7 +199,6 @@
         private static void GetResponseCallback(IAsyncResult asynchronousResult)
         {
             RequestState _requestState = (RequestState)asynchronousResult.AsyncState;
-
             // End the operation
             try
             {
@@ -180,6 +210,7 @@
             }
             catch (Exception ex)
             {
+                UnityEngine.Debug.LogException(ex);
                 _requestState.Response.OnFinish(new CallbackDetail<HttpWebResponse> { IsFaulted = true, Exception = ex });
             }
         }
@@ -203,4 +234,4 @@
         }
     }
 }
-#endif+#endif


Move to location or running will stop if you hit a key while traveling.

--- Trunk/MageCrawl/AutoTraveler.cs
+++ Trunk/MageCrawl/AutoTraveler.cs
@@ -56,6 +56,10 @@

             while (!m_engine.DangerInLOS() && ableToMoveNextSquare)
             {
+                // If user hits a key while traveling, stop
+                if (libtcodWrapper.Keyboard.CheckForKeypress(libtcodWrapper.KeyPressType.Pressed).Pressed)
+                    break;
+
                 ableToMoveNextSquare = m_engine.MovePlayer(direction);
                 m_gameInstance.UpdatePainters();

@@ -73,6 +77,10 @@

             while (!m_engine.DangerInLOS() && ableToMoveNextSquare)
             {
+                // If user hits a key while traveling, stop
+                if (libtcodWrapper.Keyboard.CheckForKeypress(libtcodWrapper.KeyPressType.Pressed).Pressed)
+                    break;
+
                 List<Point> pathToPoint = m_engine.PlayerPathToPoint(selected);
                 if (pathToPoint == null || pathToPoint.Count == 0)
                     return false;


ISSUE #39 FIXED bug in AddHighlight() and RemoveHighlight()

--- WPFHexaEditor/HexEditor.xaml.cs
+++ WPFHexaEditor/HexEditor.xaml.cs
@@ -2930,7 +2930,7 @@

                 if (!highLight) return position;

-                AddHighLight(position, data.Length);
+                AddHighLight(position, data.Length, false);

                 SetScrollMarker(position, ScrollMarker.SearchHighLight);

@@ -2967,7 +2967,7 @@

                 if (!highLight) return position;

-                AddHighLight(position, data.Length);
+                AddHighLight(position, data.Length, false);

                 SetScrollMarker(position, ScrollMarker.SearchHighLight);

@@ -3005,7 +3005,7 @@

                 if (!highLight) return position;

-                AddHighLight(position, data.Length);
+                AddHighLight(position, data.Length, false);

                 SetScrollMarker(position, ScrollMarker.SearchHighLight);

@@ -3066,7 +3066,7 @@
                 var findAll = positions as IList<long> ?? positions.ToList();
                 foreach (var position in findAll)
                 {
-                    AddHighLight(position, data.Length);
+                    AddHighLight(position, data.Length, false);

                     SetScrollMarker(position, ScrollMarker.SearchHighLight);
                 }
@@ -3857,18 +3857,34 @@
             ClearScrollMarker(ScrollMarker.SearchHighLight);
         }

-        public void AddHighLight(long startPosition, long length)
-        {
-            if (!_markedPositionList.ContainsValue(startPosition))
-                for (var i = startPosition; i < startPosition + length; i++)
+        /// <summary>
+        /// Add highlight at position start
+        /// </summary>
+        /// <param name="startPosition">Position to start the highlight</param>
+        /// <param name="length">The length to highlight</param>
+        /// <param name="updateVisual">Set to true for update the visual after adding</param>
+        public void AddHighLight(long startPosition, long length, bool updateVisual = true)
+        {
+            for (var i = startPosition; i < startPosition + length; i++)
+                if (!_markedPositionList.ContainsValue(i))
                     _markedPositionList.Add(i, i);
-        }
-
-        public void RemoveHighLight(long startPosition, long length)
-        {
-            if (!_markedPositionList.ContainsValue(startPosition))
-                for (var i = startPosition; i < startPosition + length; i++)
+
+            if (updateVisual) UpdateHighLight();
+        }
+
+        /// <summary>
+        /// Remove highlight from position start
+        /// </summary>
+        /// <param name="startPosition">Position to start the remove of highlight</param>
+        /// <param name="length">The length of highlight to removing</param>
+        /// <param name="updateVisual">Set to true for update the visual after removing</param>
+        public void RemoveHighLight(long startPosition, long length, bool updateVisual = true)
+        {
+            for (var i = startPosition; i < startPosition + length; i++)
+                if (_markedPositionList.ContainsValue(i))
                     _markedPositionList.Remove(i);
+
+            if (updateVisual) UpdateHighLight();
         }


Edited code that enables the resync functionality to check on all active profiles.

git-svn-id: ee144a4ada4e65570a65b3ba2a4ac9d4eedc8fa4@994112 13f79535-47bb-0310-9956-ffa450edef68

--- assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPanday/ProjectImporter/Digest/Model/Reference.cs
+++ assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPanday/ProjectImporter/Digest/Model/Reference.cs
@@ -274,15 +274,16 @@
                 }
                 List<string> activeProfiles = new List<string>();
                 activeProfiles.AddRange(settings.activeProfiles);
+
                 foreach (Profile profile in settings.profiles)
                 {
-                    if ("NPanday.id".Equals(profile.id))
+                    if (activeProfiles.Contains(profile.id))
                     {
                         foreach (Repository repo in profile.repositories)
                         {
                             ArtifactContext artifactContext = new ArtifactContext();
                             artifact.RemotePath = artifactContext.GetArtifactRepository().GetRemoteRepositoryPath(artifact, repo.url, ext);
-
+
                             if (downloadArtifact(artifact))
                             {
                                 return true;
@@ -291,7 +292,7 @@
                         break;
                     }
                 }
-                return false;
+                return false;
             }
             catch
             {


Fix API requests.

Fix API requests.

--- WalletWasabi.Backend/Startup.cs
+++ WalletWasabi.Backend/Startup.cs
@@ -75,14 +75,15 @@
 		{
 			app.UseStaticFiles();

-			app.UseRouting();
-
-			app.UseAuthorization();
 			// Enable middleware to serve generated Swagger as a JSON endpoint.
 			app.UseSwagger();

 			// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
 			app.UseSwaggerUI(c => c.SwaggerEndpoint($"/swagger/v{Constants.BackendMajorVersion}/swagger.json", "Wasabi Wallet API V3"));
+
+			app.UseRouting();
+
+			app.UseAuthorization();

 			// So to correctly handle HEAD requests.
 			// https://www.tpeczek.com/2017/10/exploring-head-method-behavior-in.html
@@ -90,6 +91,8 @@
 			app.UseMiddleware<HeadMethodMiddleware>();

 			app.UseResponseCompression();
+
+			app.UseEndpoints(endpoints => endpoints.MapControllers());

 			var applicationLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>();
 			applicationLifetime.ApplicationStopping.Register(() => OnShutdown(global)); // Don't register async, that won't hold up the shutdown