Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Updated breadcrumb type for scene changes #2028

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Feb 20, 2025

This helps (visually) to distinguish the breadcrumb's type for scene loading.

Before

Screenshot 2025-02-20 at 16 48 56

After

Screenshot 2025-02-20 at 16 51 12

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Updated breadcrumb type for scene changes ([#2028](https://github.com/getsentry/sentry-unity/pull/2028))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 23ab25f

@@ -29,7 +29,8 @@ void OnSceneManagerOnSceneLoaded(SceneAdapter scene, LoadSceneMode mode)

hub.AddBreadcrumb(
message: $"Scene '{scene.Name}' was loaded",
category: "scene.loaded");
category: "scene.loaded",
type: "navigation");
Copy link
Collaborator

Choose a reason for hiding this comment

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

navigation breadcrumbs should also have data. From the develop docs:

navigation
A navigation event can be a URL change in a web application, or a UI transition in a mobile or desktop application, etc.
Internally we display breadcrumbs of type default that contain category navigation as a breadcrumb of type navigation.

Its data property has the following sub-properties:

from (Required)

A string representing the original application state / location.

to (Required)

A string representing the new application state / location.

{
  "type": "navigation",
  "category": "navigation",
  "timestamp": "2016-04-20T20:55:53.845Z",
  "data": {
    "from": "/login",
    "to": "/dashboard"
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just thinking out loud here: You can load scenes additionally, how'd that work with the from->to?

Copy link
Member

Choose a reason for hiding this comment

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

could be current vs previous ? it can be anything that makes sense here

Copy link
Collaborator

Choose a reason for hiding this comment

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

then, I guess it's not a navigation event

Copy link
Contributor Author

@bitsandfoxes bitsandfoxes Feb 21, 2025

Choose a reason for hiding this comment

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

That'd actually make sense. As in: Which scene cause which other scene to load. That'd be actually super useful in specifically that case. How else would you know where this scene is coming from?

Copy link
Contributor Author

@bitsandfoxes bitsandfoxes Feb 21, 2025

Choose a reason for hiding this comment

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

Sounds good - doesn't work. The fromScene in the ActiveSceneChanged call is always null. In all Unity versions. So all the change to type really does is change the icon.

@bitsandfoxes bitsandfoxes marked this pull request as draft February 24, 2025 10:31
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.

4 participants