From 708d0448dde69a9341f44cd2a2d5b491e406a28d Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 28 Oct 2022 17:47:36 -0300 Subject: [PATCH 1/4] ignore messages from protocol extensions even for unknown context --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index b34437b7238cc..93922b09410c6 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -283,6 +283,9 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C if (pauseOnException != PauseOnExceptionsKind.Unset) _defaultPauseOnExceptions = pauseOnException; } + //ignore messages from protocol extensions even for unknown context + if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) + return true; return false; } From 6761d3301a86417473ba141fa6d74f7400ffb69f Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 28 Oct 2022 17:54:00 -0300 Subject: [PATCH 2/4] Addressing @radical comments --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 93922b09410c6..14f2f4e1943de 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -283,7 +283,7 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C if (pauseOnException != PauseOnExceptionsKind.Unset) _defaultPauseOnExceptions = pauseOnException; } - //ignore messages from protocol extensions even for unknown context + // don't pass through DotnetDebugger.* messages to the browser if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) return true; return false; @@ -585,7 +585,9 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C } } } - + // don't pass through DotnetDebugger.* messages to the browser + if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) + return true; return false; } From 1c614d2ec08a2ce739de2a4f2702aa26f75b1c6b Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 28 Oct 2022 17:57:00 -0300 Subject: [PATCH 3/4] adressing @radical comments --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 14f2f4e1943de..9ddd4434f9438 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -284,9 +284,7 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C _defaultPauseOnExceptions = pauseOnException; } // don't pass through DotnetDebugger.* messages to the browser - if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) - return true; - return false; + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); } switch (method) @@ -586,9 +584,7 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C } } // don't pass through DotnetDebugger.* messages to the browser - if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) - return true; - return false; + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); } private async Task ApplyUpdates(MessageId id, JObject args, CancellationToken token) From 35e266ad745e5eb81e405f0b09b60fe366113f67 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 28 Oct 2022 18:04:06 -0300 Subject: [PATCH 4/4] adressing @radical comments --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 9ddd4434f9438..0d5f948259c75 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -283,7 +283,7 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C if (pauseOnException != PauseOnExceptionsKind.Unset) _defaultPauseOnExceptions = pauseOnException; } - // don't pass through DotnetDebugger.* messages to the browser + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); } @@ -583,7 +583,7 @@ protected override async Task AcceptCommand(MessageId id, JObject parms, C } } } - // don't pass through DotnetDebugger.* messages to the browser + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); }