feat: Added active scene's name to unity context#2084
Merged
bitsandfoxes merged 3 commits intomainfrom Apr 2, 2025
Merged
Conversation
Contributor
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for reporting the active scene's name in the Unity context to help diagnose issues related to scene loading.
- Updated tests to verify the new ActiveSceneName property in Sentry contexts.
- Modified protocol serialization/deserialization and integration to include ActiveSceneName.
- Adjusted the scene manager interface and fake implementation to support retrieving the active scene name.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/Sentry.Unity.Tests/UnityEventScopeTests.cs | Added assertions to verify the active scene's name is included in the Unity context. |
| test/Sentry.Unity.Tests/SceneManagerIntegrationTests.cs | Changed FakeSceneManager access level and added GetActiveScene method. |
| test/Sentry.Unity.Tests/Protocol/UnityTests.cs | Updated tests to check serialization and cloning of ActiveSceneName. |
| src/Sentry.Unity/Protocol/Unity.cs | Introduced the ActiveSceneName property and updated JSON serialization/deserialization. |
| src/Sentry.Unity/Integrations/UnityScopeIntegration.cs | Made the scene manager dependency optional and updated scope configuration. |
| src/Sentry.Unity/Integrations/ISceneManager.cs | Added GetActiveScene to the interface and its adapter. |
| CHANGELOG.md | Documented the feature addition for reporting the active scene's name. |
Comments suppressed due to low confidence (1)
test/Sentry.Unity.Tests/UnityEventScopeTests.cs:162
- [nitpick] There is an inconsistency in casing: here the scene name is accessed as 'name' while in other tests it is referred to as 'Name'. Consider standardizing the casing for improved clarity and consistency.
Assert.AreEqual(SceneManager.GetActiveScene().name, unityContext.ActiveSceneName);
vaind
approved these changes
Apr 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #2073
Adds the active scene's name to the Unity context.