From ed148267de6bce771b554b647b64d45ab507f36d Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 12 May 2025 20:37:37 +0800 Subject: [PATCH 1/4] Do not show error message for initialization if plugin is already disabled --- Flow.Launcher.Core/Plugin/PluginManager.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index a3e80a73f74..eb775c2f0a7 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -220,9 +220,17 @@ public static async Task InitializePluginsAsync() catch (Exception e) { API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e); - pair.Metadata.Disabled = true; - pair.Metadata.HomeDisabled = true; - failedPlugins.Enqueue(pair); + if (pair.Metadata.Disabled && pair.Metadata.HomeDisabled) + { + // If this plugin is already disabled, do not show error message again + // Or else it will be shown every time + } + else + { + pair.Metadata.Disabled = true; + pair.Metadata.HomeDisabled = true; + failedPlugins.Enqueue(pair); + } } })); From 7509a86cbfde81f7a0696049b2e0438e6bff4f9a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 13 May 2025 09:47:46 +0800 Subject: [PATCH 2/4] Use skip message for failed initialization when plugin is already disabled --- Flow.Launcher.Core/Plugin/PluginManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index eb775c2f0a7..c9d13b61db3 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -219,17 +219,18 @@ public static async Task InitializePluginsAsync() } catch (Exception e) { - API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e); if (pair.Metadata.Disabled && pair.Metadata.HomeDisabled) { // If this plugin is already disabled, do not show error message again // Or else it will be shown every time + API.LogDebug(ClassName, $"Skip init for <{pair.Metadata.Name}>"); } else { pair.Metadata.Disabled = true; pair.Metadata.HomeDisabled = true; failedPlugins.Enqueue(pair); + API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e); } } })); From 810f7bb4a79e76f6c8a950240113500199948702 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 13 May 2025 09:58:24 +0800 Subject: [PATCH 3/4] Add disable information --- Flow.Launcher.Core/Plugin/PluginManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index c9d13b61db3..690fda011f0 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -219,6 +219,7 @@ public static async Task InitializePluginsAsync() } catch (Exception e) { + API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e); if (pair.Metadata.Disabled && pair.Metadata.HomeDisabled) { // If this plugin is already disabled, do not show error message again @@ -230,7 +231,7 @@ public static async Task InitializePluginsAsync() pair.Metadata.Disabled = true; pair.Metadata.HomeDisabled = true; failedPlugins.Enqueue(pair); - API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e); + API.LogDebug(ClassName, $"Disable plugin <{pair.Metadata.Name}> because init failed"); } } })); From a73ff5f1227598231420e7778a0f76ded73a9c14 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 13 May 2025 13:07:49 +1000 Subject: [PATCH 4/4] update comment --- Flow.Launcher.Core/Plugin/PluginManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 690fda011f0..aae8dd76419 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -224,7 +224,7 @@ public static async Task InitializePluginsAsync() { // If this plugin is already disabled, do not show error message again // Or else it will be shown every time - API.LogDebug(ClassName, $"Skip init for <{pair.Metadata.Name}>"); + API.LogDebug(ClassName, $"Skipped init for <{pair.Metadata.Name}> due to error"); } else {