Reproduce RUMS-5469: TTID not emitted when launch Activity finishes before first draw#3357
Closed
Reproduce RUMS-5469: TTID not emitted when launch Activity finishes before first draw#3357
Conversation
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.
Summary
Reproduces RUMS-5469: Android TTID not emitted on emulators (API 34) when an interstitial
Activity (e.g. AuthenticationActivity) calls finish() before its decor view completes a
single draw pass.
Test 1 (
RumFirstDrawTimeReporterTest): Asserts that when the decor view detaches fromthe window before
onViewAttachedToWindowfires,onFirstFrameDrawnis still called witha fallback timestamp. FAILS in buggy code because
onViewDetachedFromWindowis an emptybody with no fallback.
Test 2 (
RumAppStartupDetectorImplTest): Asserts that when a second Activity is createdwhile the first is still alive (interstitial pattern),
onAppStartupDetectedis called forboth Activities so that TTID can be tracked for the one that actually draws. FAILS in buggy
code because
onBeforeActivityCreatedonly fires whennumberOfActivities == 1.Test 3 (
RumSessionScopeStartupManagerTest): Asserts that whenreportAppFullyDisplayedis called and TTID was never received (because the first Activity's view detached before
drawing), a TTFD event is still written. FAILS in buggy code because
onTTFDEventreturnsearly with a warning and never writes anything when TTID has not yet been reported.
Test plan
./gradlew :features:dd-sdk-android-rum:test— all three new tests should FAILagainst the current code, confirming the bug exists
🤖 Generated with Claude Code