From 9942b80754682e119c97d59d690433ffae321571 Mon Sep 17 00:00:00 2001 From: Tem Revil Date: Fri, 10 Jul 2026 17:09:33 +0300 Subject: [PATCH 1/2] fix: CS8604 nullable warning in TodoApp.Avalonia LoggingHandler WriteContentAsync declared a non-nullable HttpContent parameter but both call sites pass HttpContent? (request.Content / response.Content), which raised CS8604 in every TodoApp.Avalonia CI build since the samples got CI coverage. The method already null-checks, so the parameter type just needed to match actual usage. --- .../TodoApp.Avalonia/Services/LoggingHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs index 971ee140..657e4bf7 100644 --- a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs +++ b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs @@ -35,7 +35,7 @@ protected override async Task SendAsync(HttpRequestMessage return response; } - private static async Task WriteContentAsync(HttpContent content, CancellationToken cancellationToken = default) + private static async Task WriteContentAsync(HttpContent? content, CancellationToken cancellationToken = default) { if (content != null) { From 63d107e4717580cf9d95ade5ae68a5596126d94e Mon Sep 17 00:00:00 2001 From: Tem Revil Date: Fri, 10 Jul 2026 21:31:59 +0300 Subject: [PATCH 2/2] fix: assert instead of skip on null content in LoggingHandler request.Content and response.Content are never actually null in this sample app's flow, so the silent skip masked the case rather than surfacing it. Debug.Assert keeps the CS8604 fix from #544 while making an unexpected null loud instead of quiet, per review feedback. --- .../TodoApp.Avalonia/Services/LoggingHandler.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs index 657e4bf7..5d0bc3c9 100644 --- a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs +++ b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs @@ -37,9 +37,7 @@ protected override async Task SendAsync(HttpRequestMessage private static async Task WriteContentAsync(HttpContent? content, CancellationToken cancellationToken = default) { - if (content != null) - { - Debug.WriteLine($"[HTTP] >>> {await content.ReadAsStringAsync(cancellationToken)}"); - } + Debug.Assert(content != null, "Request/response content should never be null here."); + Debug.WriteLine($"[HTTP] >>> {await content.ReadAsStringAsync(cancellationToken)}"); } }