Skip to content

feat: Added active scene's name to unity context#2084

Merged
bitsandfoxes merged 3 commits intomainfrom
feat/scene-name
Apr 2, 2025
Merged

feat: Added active scene's name to unity context#2084
bitsandfoxes merged 3 commits intomainfrom
feat/scene-name

Conversation

@bitsandfoxes
Copy link
Copy Markdown
Contributor

@bitsandfoxes bitsandfoxes commented Mar 27, 2025

Relates to #2073
Adds the active scene's name to the Unity context.

Screenshot 2025-03-27 at 16 21 50

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 837d884

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

@bitsandfoxes bitsandfoxes merged commit 3943f90 into main Apr 2, 2025
6 checks passed
@bitsandfoxes bitsandfoxes deleted the feat/scene-name branch April 2, 2025 06:46
@bitsandfoxes bitsandfoxes mentioned this pull request Apr 3, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants