Skip to content

Commit 80b0b60

Browse files
committed
handle version parse fail and reorder last manifest fetch date
1 parent 7208b72 commit 80b0b60

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
4343
if (results.Count == 0)
4444
return false;
4545

46-
lastFetchedAt = DateTime.Now;
47-
4846
var updatedPluginResults = new List<UserPlugin>();
4947
var appVersion = SemanticVersioning.Version.Parse(Constant.Version);
5048

@@ -56,6 +54,8 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
5654

5755
UserPlugins = updatedPluginResults;
5856

57+
lastFetchedAt = DateTime.Now;
58+
5959
return true;
6060
}
6161
}
@@ -73,9 +73,21 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
7373

7474
private static bool IsMinimumAppVersionSatisfied(UserPlugin plugin, SemanticVersioning.Version appVersion)
7575
{
76-
if (string.IsNullOrEmpty(plugin.MinimumAppVersion) || appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
76+
if (string.IsNullOrEmpty(plugin.MinimumAppVersion))
7777
return true;
7878

79+
try
80+
{
81+
if (appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
82+
return true;
83+
}
84+
catch (Exception e)
85+
{
86+
API.LogException(ClassName, $"Failed to parse the minimum app version {plugin.MinimumAppVersion} for plugin {plugin.Name}. "
87+
+ "Plugin excluded from manifest", e);
88+
return false;
89+
}
90+
7991
API.LogDebug(ClassName, $"Plugin {plugin.Name} requires minimum Flow Launcher version {plugin.MinimumAppVersion}, "
8092
+ $"but current version is {Constant.Version}. Plugin excluded from manifest.");
8193

0 commit comments

Comments
 (0)