Skip to content

Reproduce RUMS-5469: TTID not emitted when launch Activity finishes before first draw#3357

Closed
mariusc83 wants to merge 1 commit intodevelopfrom
mariusc83/RUMS-5469/android-ttid-not-emitted-emulators
Closed

Reproduce RUMS-5469: TTID not emitted when launch Activity finishes before first draw#3357
mariusc83 wants to merge 1 commit intodevelopfrom
mariusc83/RUMS-5469/android-ttid-not-emitted-emulators

Conversation

@mariusc83
Copy link
Copy Markdown
Member

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 from
    the window before onViewAttachedToWindow fires, onFirstFrameDrawn is still called with
    a fallback timestamp. FAILS in buggy code because onViewDetachedFromWindow is an empty
    body with no fallback.

  • Test 2 (RumAppStartupDetectorImplTest): Asserts that when a second Activity is created
    while the first is still alive (interstitial pattern), onAppStartupDetected is called for
    both Activities so that TTID can be tracked for the one that actually draws. FAILS in buggy
    code because onBeforeActivityCreated only fires when numberOfActivities == 1.

  • Test 3 (RumSessionScopeStartupManagerTest): Asserts that when reportAppFullyDisplayed
    is 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 onTTFDEvent returns
    early with a warning and never writes anything when TTID has not yet been reported.

Test plan

  • Run ./gradlew :features:dd-sdk-android-rum:test — all three new tests should FAIL
    against the current code, confirming the bug exists
  • Verify no existing tests are broken by the new test additions

🤖 Generated with Claude Code

@mariusc83 mariusc83 closed this Apr 9, 2026
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.

1 participant