Skip to content

Commit

Permalink
Merge pull request #27827 from smoogipoo/fix-ios-build
Browse files Browse the repository at this point in the history
Update Sentry to fix iOS build
  • Loading branch information
peppy authored Apr 12, 2024
2 parents 3e8ddbd + 3ec9374 commit da1a07f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions osu.Game/Utils/SentryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ public class SentryLogger : IDisposable
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;
Expand All @@ -59,12 +60,15 @@ public SentryLogger(OsuGame game)

public void AttachUser(IBindable<APIUser> user)
{
if (sentrySession == null)
return;

Debug.Assert(localUser == null);

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(),
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/osu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.329.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.410.0" />
<PackageReference Include="Sentry" Version="3.41.3" />
<PackageReference Include="Sentry" Version="4.3.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.36.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
Expand Down

0 comments on commit da1a07f

Please sign in to comment.