From 8b2017be453fb03905bc857bd117c2555cb05e69 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 12 Apr 2024 01:02:40 +0900 Subject: [PATCH 1/2] Update Sentry to fix iOS build --- osu.Game/Utils/SentryLogger.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index 61622a7122..896f4daf33 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -64,7 +64,7 @@ namespace osu.Game.Utils localUser = user.GetBoundCopy(); localUser.BindValueChanged(u => { - SentrySdk.ConfigureScope(scope => scope.User = new User + SentrySdk.ConfigureScope(scope => scope.User = new SentryUser { Username = u.NewValue.Username, Id = u.NewValue.Id.ToString(), diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 3ea756a8b8..21b5bc60a5 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -37,7 +37,7 @@ - + From 3ec93745a45127a204b1b25df81784bc1392ac2f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Apr 2024 01:07:52 +0800 Subject: [PATCH 2/2] Fix test failures due to sentry oversight --- osu.Game/Utils/SentryLogger.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index 896f4daf33..8d3e5fb834 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -39,12 +39,13 @@ namespace osu.Game.Utils public SentryLogger(OsuGame game) { this.game = game; + + if (!game.IsDeployedBuild || !game.CreateEndpoints().WebsiteRootUrl.EndsWith(@".ppy.sh", StringComparison.Ordinal)) + return; + sentrySession = SentrySdk.Init(options => { - // Not setting the dsn will completely disable sentry. - if (game.IsDeployedBuild && game.CreateEndpoints().WebsiteRootUrl.EndsWith(@".ppy.sh", StringComparison.Ordinal)) - options.Dsn = "https://ad9f78529cef40ac874afb95a9aca04e@sentry.ppy.sh/2"; - + options.Dsn = "https://ad9f78529cef40ac874afb95a9aca04e@sentry.ppy.sh/2"; options.AutoSessionTracking = true; options.IsEnvironmentUser = false; options.IsGlobalModeEnabled = true; @@ -59,6 +60,9 @@ namespace osu.Game.Utils public void AttachUser(IBindable user) { + if (sentrySession == null) + return; + Debug.Assert(localUser == null); localUser = user.GetBoundCopy();