Skip to content

Reproduce RUMS-5184: Missing request duration breakdown (ResourceId UUID mismatch)#3362

Closed
mariusc83 wants to merge 1 commit intodevelopfrom
mariusc83/RUMS-5184/missing-request-duration-breakdown
Closed

Reproduce RUMS-5184: Missing request duration breakdown (ResourceId UUID mismatch)#3362
mariusc83 wants to merge 1 commit intodevelopfrom
mariusc83/RUMS-5184/missing-request-duration-breakdown

Conversation

@mariusc83
Copy link
Copy Markdown
Member

Reproduction for RUMS-5184

Jira: RUMS-5184

Issue Summary

Request duration breakdown (DNS, connect, SSL, TTFB, download) is missing from Android RUM Resource events. The bug was introduced when DatadogEventListener.Factory.create() was changed to call buildResourceId(generateUuid = true), generating a UUID that never matches the one registered by DatadogInterceptor.

Root Cause

DatadogEventListener.Factory.create() calls buildResourceId(generateUuid = true), producing ResourceId(key, UUID_B). DatadogInterceptor.intercept() independently calls buildResourceId(generateUuid = true), producing ResourceId(key, UUID_A). Since ResourceId.equals() requires both UUIDs to match when both are non-null, and UUID_A ≠ UUID_B (independently generated), every waitForResourceTiming and addResourceTiming call from the EventListener fails to find the matching RumResourceScope. The timing field remains null and the resource event is serialized without any breakdown fields.

Reproduction Tests

  • Unit tests: 2 (in DatadogEventListenerFactoryTest, ResourceIdTest)

What the Tests Prove

  • DatadogEventListenerFactoryTest: Factory.create() returns a DatadogEventListener whose key.uuid is non-null (a random UUID). The test asserts it should be null, and FAILS — proving the mismatch.
  • ResourceIdTest: Documents the equality contract — two ResourceId instances with the same key but independently generated UUIDs are never equal, which is the mechanism that makes the mismatch fatal.

Key Failure Output

[Factory.create() must produce a ResourceId with uuid=null so it can match
 the interceptor's ResourceId via key-only fallback. Non-null uuid causes UUID mismatch
 → timing fields are never set → request duration breakdown is missing (RUMS-5184).]
Expecting: <"9d17cb95-1953-4216-b9cb-ea8fc1564fbd">
to be equal to: <null>
but was not.

Call Chain

DatadogInterceptor.intercept()
  → buildResourceId(generateUuid=true) → ResourceId(key, UUID_A)
  → startResource(ResourceId(key, UUID_A))                         [creates RumResourceScope]

DatadogEventListener.Factory.create()
  → buildResourceId(generateUuid=true) → ResourceId(key, UUID_B)   [UUID_B ≠ UUID_A]

DatadogEventListener.dnsStart/connectStart/… → waitForResourceTiming(ResourceId(key, UUID_B))
  → RumResourceScope.handleEvent() → key check FAILS (UUID_A ≠ UUID_B) → waitForTiming never set

DatadogEventListener.callEnd() → addResourceTiming(ResourceId(key, UUID_B), timing)
  → RumResourceScope.onAddResourceTiming() → key check FAILS → timing field never set

DatadogInterceptor.handleResponse() → stopResource(buildResourceId(generateUuid=false))
  → key-only match succeeds → RumResourceScope serialized with timing=null
  → ResourceEvent has no dns/connect/ssl/firstByte/download breakdown

Generated by rum:tee-triage-insights

@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