From 7182e3f9650e4de9f944d8c4e897fe4a24a3b8bc Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 29 Oct 2025 19:05:58 +0100 Subject: dotnet 10, synapse admin room list improvements --- MatrixUtils.Desktop/App.axaml.cs | 7 +++-- MatrixUtils.Desktop/MainWindow.axaml.cs | 2 +- MatrixUtils.Desktop/MatrixUtils.Desktop.csproj | 33 +++++++++++------------- MatrixUtils.Desktop/RMUDesktopConfiguration.cs | 3 +-- MatrixUtils.Desktop/SentryService.cs | 29 --------------------- MatrixUtils.Desktop/appsettings.Development.json | 21 +++++++-------- 6 files changed, 30 insertions(+), 65 deletions(-) delete mode 100644 MatrixUtils.Desktop/SentryService.cs (limited to 'MatrixUtils.Desktop') diff --git a/MatrixUtils.Desktop/App.axaml.cs b/MatrixUtils.Desktop/App.axaml.cs index 3a106ab..8a5d3e2 100644 --- a/MatrixUtils.Desktop/App.axaml.cs +++ b/MatrixUtils.Desktop/App.axaml.cs @@ -15,7 +15,6 @@ public partial class App : Application { public override void OnFrameworkInitializationCompleted() { host = Host.CreateDefaultBuilder().ConfigureServices((ctx, services) => { services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(x => new TieredStorageService( cacheStorageProvider: new FileStorageProvider(x.GetService()!.CacheStoragePath), @@ -40,10 +39,10 @@ public partial class App : Application { var scope = scopeFac.CreateScope(); desktop.MainWindow = scope.ServiceProvider.GetRequiredService(); } - - if(Environment.GetEnvironmentVariable("AVALONIA_THEME")?.Equals("dark", StringComparison.OrdinalIgnoreCase) ?? false) + + if (Environment.GetEnvironmentVariable("AVALONIA_THEME")?.Equals("dark", StringComparison.OrdinalIgnoreCase) ?? false) RequestedThemeVariant = ThemeVariant.Dark; - + base.OnFrameworkInitializationCompleted(); } } \ No newline at end of file diff --git a/MatrixUtils.Desktop/MainWindow.axaml.cs b/MatrixUtils.Desktop/MainWindow.axaml.cs index 9c783e4..a1eef56 100644 --- a/MatrixUtils.Desktop/MainWindow.axaml.cs +++ b/MatrixUtils.Desktop/MainWindow.axaml.cs @@ -14,7 +14,7 @@ public partial class MainWindow : Window { private readonly RMUDesktopConfiguration _configuration; public static MainWindow Instance { get; private set; } = null!; - public MainWindow(ILogger logger, IServiceScopeFactory scopeFactory, SentryService _) { + public MainWindow(ILogger logger, IServiceScopeFactory scopeFactory) { Instance = this; _logger = logger; _scopeFactory = scopeFactory; diff --git a/MatrixUtils.Desktop/MatrixUtils.Desktop.csproj b/MatrixUtils.Desktop/MatrixUtils.Desktop.csproj index a7ff4b9..419ae88 100644 --- a/MatrixUtils.Desktop/MatrixUtils.Desktop.csproj +++ b/MatrixUtils.Desktop/MatrixUtils.Desktop.csproj @@ -1,7 +1,7 @@  WinExe - net9.0 + net10.0 enable true app.manifest @@ -10,31 +10,28 @@ preview enable true - - - - - - + + + + + + - - - - + + + + - - + - - - - + + @@ -45,6 +42,6 @@ - + diff --git a/MatrixUtils.Desktop/RMUDesktopConfiguration.cs b/MatrixUtils.Desktop/RMUDesktopConfiguration.cs index 62646ca..f9515f6 100644 --- a/MatrixUtils.Desktop/RMUDesktopConfiguration.cs +++ b/MatrixUtils.Desktop/RMUDesktopConfiguration.cs @@ -21,7 +21,6 @@ public class RMUDesktopConfiguration { public string DataStoragePath { get; set; } = ""; public string CacheStoragePath { get; set; } = ""; - public string? SentryDsn { get; set; } private static string ExpandPath(string path, bool retry = true) { _logger.LogInformation("Expanding path `{}`", path); @@ -44,4 +43,4 @@ public class RMUDesktopConfiguration { return path; } -} +} \ No newline at end of file diff --git a/MatrixUtils.Desktop/SentryService.cs b/MatrixUtils.Desktop/SentryService.cs deleted file mode 100644 index c965632..0000000 --- a/MatrixUtils.Desktop/SentryService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Sentry; - -namespace MatrixUtils.Desktop; - -public class SentryService : IDisposable { - private IDisposable? _sentrySdkDisposable; - public SentryService(IServiceScopeFactory scopeFactory, ILogger logger) { - var config = scopeFactory.CreateScope().ServiceProvider.GetRequiredService(); - if (config.SentryDsn is null) { - logger.LogWarning("Sentry DSN is not set, skipping Sentry initialisation"); - return; - } - _sentrySdkDisposable = SentrySdk.Init(o => { - o.Dsn = config.SentryDsn; - // When configuring for the first time, to see what the SDK is doing: - o.Debug = true; - // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. - // We recommend adjusting this value in production. - o.TracesSampleRate = 1.0; - // Enable Global Mode if running in a client app - o.IsGlobalModeEnabled = true; - }); - } - - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - public void Dispose() => _sentrySdkDisposable?.Dispose(); -} diff --git a/MatrixUtils.Desktop/appsettings.Development.json b/MatrixUtils.Desktop/appsettings.Development.json index a1add03..baec0e2 100644 --- a/MatrixUtils.Desktop/appsettings.Development.json +++ b/MatrixUtils.Desktop/appsettings.Development.json @@ -1,14 +1,13 @@ { - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - }, - "RMUDesktop": { - "DataStoragePath": "rmu-desktop/data", - "CacheStoragePath": "rmu-desktop/cache", - "SentryDsn": "https://a41e99dd2fdd45f699c432b21ebce632@sentry.thearcanebrony.net/15" + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" } + }, + "RMUDesktop": { + "DataStoragePath": "rmu-desktop/data", + "CacheStoragePath": "rmu-desktop/cache" + } } -- cgit 1.5.1