You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7d8a394
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(android-fragment): support detach/attach navigation in fragment tracing (#5660)
* fix(android-fragment): support detach/attach navigation in fragment tracing
For detach/attach tab navigation (manual tab switching, ViewPager v1 with
FragmentPagerAdapter, custom navigation frameworks), onFragmentCreated is
skipped for off-screen fragments that are re-attached. Previously this left
ui.load spans open until the 30s activity transaction deadline, producing
inflated performance data.
Fix by calling startTracing in onFragmentViewCreated as well as
onFragmentCreated. startTracing is idempotent (no-op if a span is already
running), so the normal onFragmentCreated -> onFragmentViewCreated path is
unaffected. Add matching stopTracing calls in onFragmentResumed (covers the
detach/attach path where onFragmentStarted may be skipped) and
onFragmentViewDestroyed (failsafe for fragments destroyed before reaching
STARTED or RESUMED). stopTracing is also idempotent, so the normal path is
unaffected.
Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
* Format code
* Add changelog entry and detach/attach sample
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove duplicate test methods in fragment lifecycle test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: Update screen name on scope for detach/attach fragment re-attachment
onFragmentCreated is skipped during detach/attach navigation, so the
screen name was never updated for re-attached fragments. Mirror the
screen tracking into onFragmentViewCreated to cover that path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Format code
* Address PR feedback: internalize guards into startTracing and fix sample layout
Move isAdded check, screen tracking, and tracing logic into startTracing()
to deduplicate guards from onFragmentCreated and onFragmentViewCreated.
Fix DetachAttachTabsActivity sample rendering on API 35+ by using
NoActionBar theme and fitsSystemWindows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: Decouple screen tracking from performance tracing in fragments
Screen name updates on scope should work independently of whether
performance tracing is enabled.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
9
9
### Fixes
10
10
11
+
- Fix fragment tracing not working with detach/attach navigation ([#5660](https://github.com/getsentry/sentry-java/pull/5660))
11
12
- Don't start a redundant UI interaction transaction when a transaction is already bound to the Scope ([#5491](https://github.com/getsentry/sentry-java/issues/5491))
12
13
- Previously, `SentryGestureListener` always started a UI transaction and only afterwards skipped binding it to the Scope when a manually-bound transaction already existed, leaving the new transaction to be dropped as an idle transaction without children.
13
14
- Fix potential NPE within `Scope.endSession()` ([#5657](https://github.com/getsentry/sentry-java/pull/5657))
0 commit comments