-
Notifications
You must be signed in to change notification settings - Fork 38
Fixing invalid X-MiniProfiler-Ids responses #5
Conversation
Sometimes the X-MiniProfiler-Ids response contains a double-array instead of a single. With this change, we take the first one and discard the rest.
Hmm, which language are you using? It sounds like a bug in one of the server implementations - the client should expect well-formed responses from the server. |
I'm using .net mvc4. |
Yes I was able to reproduce the situation with the current source. |
Can you post code or a fork that reproduces this? |
I can give you the relevant code examples. public static void PreStart(bool autoShow)
{
MiniProfiler.Settings.SqlFormatter = new StackExchange.Profiling.SqlFormatters.SqlServerFormatter();
MiniProfiler.Settings.ExcludeStackTraceSnippetFromCustomTimings = false;
MiniProfiler.Settings.StackMaxLength = 1000;
MiniProfiler.Settings.TrivialDurationThresholdMilliseconds = 3;
MiniProfiler.Settings.IgnoredPaths =
new[]
{
"/content/", "/scripts/", "/favicon.ico", "/images/", "/viewscripts/"
};
MiniProfilerEF.InitializeEF42(false);
GlobalFilters.Filters.Add(new ProfilingActionFilter());
MiniProfiler.Settings.PopupShowTrivial = false;
MiniProfiler.Settings.PopupRenderPosition = RenderPosition.Right;
MiniProfiler.Settings.PopupMaxTracesToShow = 50;
MiniProfiler.Settings.ShowControls = autoShow;
MiniProfiler.Settings.PopupShowTimeWithChildren = true;
} public static void PostStart()
{
var copy = ViewEngines.Engines.ToList();
ViewEngines.Engines.Clear();
foreach (var item in copy)
{
ViewEngines.Engines.Add(new ProfilingViewEngine(item));
}
} static void OnBeginRequest(HttpRequest request)
{
if (request.IsLocal)
{
MiniProfiler.Start();
}
} public static void OnEndRequest()
{
MiniProfiler.Stop();
} I call these functions on my own during the app-startup, not via the attributes. Is that enough? |
any updates on this issue? |
bump? |
Has any progress been made towards fixing this bug? We're also experiencing it in our ASP.NET MVC 4 application. |
Please move this issue to https://github.com/MiniProfiler/dotnet. |
Due my current situation (changed company + project) I'm not interested in the solution anymore. @jcoutch, can you take the responsibility? |
@SeriousM - Sorry for the delay...been busy the past couple months. Sure, I'll move it over to the dotnet project and follow up. |
Sometimes the X-MiniProfiler-Ids response contains a double-array instead of a single.
With this change, we take the first one and discard the rest.
A normal response looks like that:
["94A4A68F-C2C5-4A66-8369-CC5DAAEF3640"]
Sometimes I get this response:
I do not know why, but this is a fix/workaround for that.
Edit:
I forgot to mention that all the id-parsings now also bundled in one method.