From a71b3b54ceaaf4ebb2a81e73c4f0a3ba469f0e0a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 21 Jul 2026 15:44:11 +0000 Subject: [PATCH] Simplify os_description trim and drop no-op Process.delete Use a single if/case for blank normalization per review feedback, and remove Process.delete from on_exit (runs in a different process). Co-authored-by: Dominic Letz --- lib/desktop/platform/system.ex | 14 +++++--------- test/desktop/platform_system_test.exs | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/desktop/platform/system.ex b/lib/desktop/platform/system.ex index 746f893..4f99537 100644 --- a/lib/desktop/platform/system.ex +++ b/lib/desktop/platform/system.ex @@ -49,15 +49,11 @@ defmodule Desktop.Platform.System do end end) - case raw do - nil -> - nil - - str -> - case String.trim(str) do - "" -> nil - trimmed -> trimmed - end + if raw do + case String.trim(raw) do + "" -> nil + trimmed -> trimmed + end end end diff --git a/test/desktop/platform_system_test.exs b/test/desktop/platform_system_test.exs index d6ecb71..bbf0a12 100644 --- a/test/desktop/platform_system_test.exs +++ b/test/desktop/platform_system_test.exs @@ -16,7 +16,6 @@ defmodule Desktop.Platform.SystemTest do on_exit(fn -> Application.put_env(:desktop, :backend, previous) - Process.delete(:stub_os_description) end) :ok