From 45a0989b944881b77417ff13b020a13bb5854da7 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 28 Oct 2022 18:09:00 -0300 Subject: [PATCH] Ignore messages from protocol extensions even if it's from an unknown context --- .../wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index e4940edb7b2bed..95a86902d1e02e 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -250,7 +250,10 @@ protected override async Task AcceptCommand(MessageId id, string method, J await AttachToTarget(id, token); if (!contexts.TryGetValue(id, out ExecutionContext context)) - return false; + { + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); + } switch (method) { @@ -536,11 +539,8 @@ protected override async Task AcceptCommand(MessageId id, string method, J } } - //ignore all protocol extension messages not supported on .net6 - if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) - return true; - - return false; + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); } private async Task CallOnFunction(MessageId id, JObject args, CancellationToken token) {