getsentry / getsentry/sentry-cocoa

Wrong app context view names for screen load transactions

Open
#3,969 0 comments 0 reactions 0 assignees View on GitHub
Bug Cocoa Spans
Dominant language
Swift
Stars
1.1k
Forks
418
Avg merge
2d 3h
Merged PRs (30d)
106

Description

### Platform

iOS

### Environment

Develop, TestFlight

### Installed

Manually

### Version

8.25.2

### Did it work on previous versions?

Maybe

### Steps to Reproduce

1. Open iOS-Swift sample app
2. Check screen load transaction in Sentry

### Expected Result

The view_names in the app context should match the transaction name.

### Actual Result

The view_names sometimes is `UITabBarController` or something different. Checkout this sample transaction in [Sentry]()

I guess this is because we add the view_names to the transaction in the client
[https://github.com/getsentry/sentry-cocoa/blob/e072ad1b27ff5e6413edd2e4716a5ef0be4eee04/Sources/Sentry/SentryClient.m#L870-L881]()

As the SDK captures the transaction on a background thread, the app navigates to a new screen after it captures the auto-generated screen load transaction.

[https://github.com/getsentry/sentry-cocoa/blob/e072ad1b27ff5e6413edd2e4716a5ef0be4eee04/Sources/Sentry/SentryHub.m#L291-L300]()

### Are you willing to submit a PR?

*No response*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.