From eb545bf892db331892f3fa5141cc8c77d60a8782 Mon Sep 17 00:00:00 2001 From: Albie Spriddell Date: Mon, 11 Nov 2024 08:14:34 +0000 Subject: [PATCH 1/3] handle url launch failure --- DragonFruit.OnionFruit/App.axaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/DragonFruit.OnionFruit/App.axaml.cs b/DragonFruit.OnionFruit/App.axaml.cs index 2ce9b4b..026b4da 100644 --- a/DragonFruit.OnionFruit/App.axaml.cs +++ b/DragonFruit.OnionFruit/App.axaml.cs @@ -22,6 +22,7 @@ using LucideAvalonia.Enum; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; using Nito.AsyncEx; using ReactiveUI; @@ -254,7 +255,15 @@ public static bool Launch(string url) UseShellExecute = true }; - return Process.Start(psi) != null; + try + { + return Process.Start(psi) != null; + } + catch (Exception e) + { + Instance.Services.GetRequiredService>().LogWarning(e, "Failed to launch URL due to an error: {err}", e.Message); + return false; + } } public static IconSource GetIcon(LucideIconNames icon, IImmutableSolidColorBrush brush = null, double thickness = 1.5) From 756d8da965b370aee06b4f91da7ca3c1cd35900f Mon Sep 17 00:00:00 2001 From: Albie Spriddell Date: Mon, 11 Nov 2024 08:27:21 +0000 Subject: [PATCH 2/3] updater-related string changes --- DragonFruit.OnionFruit/Updater/VelopackUpdater.cs | 2 +- .../ViewModels/AboutPageTabViewModel.cs | 4 ++-- DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DragonFruit.OnionFruit/Updater/VelopackUpdater.cs b/DragonFruit.OnionFruit/Updater/VelopackUpdater.cs index 32ac624..4303e1b 100644 --- a/DragonFruit.OnionFruit/Updater/VelopackUpdater.cs +++ b/DragonFruit.OnionFruit/Updater/VelopackUpdater.cs @@ -89,7 +89,7 @@ private async Task PerformUpdateCheckInternal() } catch (Exception e) { - _logger.LogError(e, "Failed to perform updater: {message}", e.Message); + _logger.LogError(e, "Failed to perform update: {message}", e.Message); Status = OnionFruitUpdaterStatus.Failed; } } diff --git a/DragonFruit.OnionFruit/ViewModels/AboutPageTabViewModel.cs b/DragonFruit.OnionFruit/ViewModels/AboutPageTabViewModel.cs index 70739fa..6f67a50 100644 --- a/DragonFruit.OnionFruit/ViewModels/AboutPageTabViewModel.cs +++ b/DragonFruit.OnionFruit/ViewModels/AboutPageTabViewModel.cs @@ -51,10 +51,10 @@ public AboutPageTabViewModel(IOnionFruitUpdater updater, ILogger "Checking for updates...", - OnionFruitUpdaterStatus.Downloading when x.Second.HasValue => $"Downloading update ({x.Second}%)", + OnionFruitUpdaterStatus.Downloading when x.Second.HasValue => $"Downloading ({x.Second}%)", OnionFruitUpdaterStatus.Failed when x.Second.HasValue => "Update failed", - OnionFruitUpdaterStatus.Downloading => "Downloading update...", + OnionFruitUpdaterStatus.Downloading => "Downloading...", OnionFruitUpdaterStatus.Failed => "Update check failed", OnionFruitUpdaterStatus.UpToDate => "No updates available", diff --git a/DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs b/DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs index 5e13895..31eb1bb 100644 --- a/DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs +++ b/DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs @@ -225,10 +225,10 @@ private static IEnumerable ProcessCountries(EventPattern current.Status switch { - OnionFruitUpdaterStatus.Downloading when current.Progress.HasValue => $"{App.Title} - Downloading update ({current.Progress}%)", - OnionFruitUpdaterStatus.Downloading => $"{App.Title} - Downloading update", - OnionFruitUpdaterStatus.PendingRestart => $"{App.Title} - Update downloaded (pending restart)", - OnionFruitUpdaterStatus.Failed => $"{App.Title} - Update failed", + OnionFruitUpdaterStatus.Downloading when current.Progress.HasValue => $"{App.Title} - Downloading Update ({current.Progress}%)", + OnionFruitUpdaterStatus.Downloading => $"{App.Title} - Downloading Update", + OnionFruitUpdaterStatus.PendingRestart => $"{App.Title} - Update Downloaded", + OnionFruitUpdaterStatus.Failed => $"{App.Title} - Update Failed", _ => App.Title }; From c5f949064caef97699ce9b95a76ad88b347284b9 Mon Sep 17 00:00:00 2001 From: Albie Date: Mon, 11 Nov 2024 08:31:23 +0000 Subject: [PATCH 3/3] add missing github token --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e5e01e..ab6e91a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,6 +77,8 @@ jobs: - name: Validate Deployment Tool Attestation working-directory: ${{ steps.deploytool.outputs.home }} run: gh attestation verify DragonFruit.OnionFruit.Deploy.dll --repo dragonfruitnetwork/onionfruit-deploy --deny-self-hosted-runners + env: + GH_TOKEN: ${{ github.token }} - name: Restore .NET Tools run: dotnet tool restore