Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083))
- The SDK now reports the active scene's name as part of the `Unity Context` ([2084](https://github.com/getsentry/sentry-unity/pull/2084))

### Dependencies
Expand Down
1 change: 1 addition & 0 deletions src/Sentry.Unity/Integrations/UnityScopeIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private static void PopulateSdk(SdkVersion sdk)

private void PopulateApp(App app)
{
app.Name = _application.ProductName;
app.StartTime = MainThreadData.StartTime;
var isDebugBuild = MainThreadData.IsDebugBuild;
app.BuildType = isDebugBuild is null ? null : (isDebugBuild.Value ? "debug" : "release");
Expand Down
17 changes: 17 additions & 0 deletions test/Sentry.Unity.Tests/UnityEventScopeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,34 @@ public void DeviceUniqueIdentifierWithSendDefaultPii_IsNotNull()
public void AppProtocol_Assigned()
{
// arrange
_testApplication = new TestApplication(productName: "TestGame");
var sut = new UnityScopeUpdater(_sentryOptions, _testApplication);
var scope = new Scope(_sentryOptions);

// act
sut.ConfigureScope(scope);

// assert
Assert.IsNotNull(scope.Contexts.App.Name);
Assert.IsNotNull(scope.Contexts.App.StartTime);
Assert.IsNotNull(scope.Contexts.App.BuildType);
}

[Test]
public void AppProtocol_AppNameIsApplicationName()
{
// arrange
_testApplication = new TestApplication(productName: "TestGame");
var sut = new UnityScopeUpdater(_sentryOptions, _testApplication);
var scope = new Scope(_sentryOptions);

// act
sut.ConfigureScope(scope);

// assert
Assert.AreEqual(scope.Contexts.App.Name, _testApplication.ProductName);
}

[Test]
public void UserId_SetIfEmpty()
{
Expand Down
Loading