Skip to content

Commit

Permalink
Merge pull request #31417 from peppy/enable-sentry-caching
Browse files Browse the repository at this point in the history
Enable sentry caching to avoid sentry writing outside of game directory
  • Loading branch information
bdach authored Jan 29, 2025
2 parents b84a9f7 + fd1d90c commit c079969
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2025.115.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2025.129.1" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Expand Down
8 changes: 6 additions & 2 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ public OsuGame(string[] args = null)

forwardGeneralLogsToNotifications();
forwardTabletLogsToNotifications();

SentryLogger = new SentryLogger(this);
}

#region IOverlayManager
Expand Down Expand Up @@ -320,6 +318,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
private readonly List<string> dragDropFiles = new List<string>();
private ScheduledDelegate dragDropImportSchedule;

public override void SetupLogging(Storage gameStorage, Storage cacheStorage)
{
base.SetupLogging(gameStorage, cacheStorage);
SentryLogger = new SentryLogger(this, cacheStorage);
}

public override void SetHost(GameHost host)
{
base.SetHost(host);
Expand Down
4 changes: 3 additions & 1 deletion osu.Game/Utils/SentryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Bindables;
using osu.Framework.Configuration;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Statistics;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
Expand All @@ -36,7 +37,7 @@ public class SentryLogger : IDisposable

private readonly OsuGame game;

public SentryLogger(OsuGame game)
public SentryLogger(OsuGame game, Storage? storage = null)
{
this.game = game;

Expand All @@ -49,6 +50,7 @@ public SentryLogger(OsuGame game)
options.AutoSessionTracking = true;
options.IsEnvironmentUser = false;
options.IsGlobalModeEnabled = true;
options.CacheDirectoryPath = storage?.GetFullPath(string.Empty);
// The reported release needs to match version as reported to Sentry in .github/workflows/sentry-release.yml
options.Release = $"osu@{game.Version.Replace($@"-{OsuGameBase.BUILD_SUFFIX}", string.Empty)}";
});
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 @@ -35,7 +35,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="20.1.0" />
<PackageReference Include="ppy.osu.Framework" Version="2025.117.0" />
<PackageReference Include="ppy.osu.Framework" Version="2025.129.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.1224.0" />
<PackageReference Include="Sentry" Version="5.0.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
Expand Down
2 changes: 1 addition & 1 deletion osu.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<MtouchInterpreter>-all</MtouchInterpreter>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2025.117.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2025.129.1" />
</ItemGroup>
</Project>

0 comments on commit c079969

Please sign in to comment.