Skip to content

RUM-11716: Check for result of activity.intent#2877

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-11716/check-for-activity.intent-result
Sep 16, 2025
Merged

RUM-11716: Check for result of activity.intent#2877
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-11716/check-for-activity.intent-result

Conversation

@0xnm

@0xnm 0xnm commented Sep 15, 2025

Copy link
Copy Markdown
Member

What does this PR do?

There is the following SDK crash reported:

java.lang.RuntimeException: Unable to start activity ComponentInfo{....}: java.lang.NullPointerException: activity.intent must not be null
	at com.datadog.android.rum.tracking.ActivityLifecycleTrackingStrategy.onActivityCreated(ActivityLifecycleTrackingStrategy.kt:97)
	at android.app.Application.dispatchActivityCreated(Application.java:373)
	at android.app.Activity.dispatchActivityCreated(Activity.java:1316)
	at android.app.Activity.onCreate_aroundBody0(Activity.java:1589)
	at android.app.Activity$AjcClosure1.run(Activity.java:1)
	at <redacted>(unknown:2)
	at android.app.Activity.onCreate(Activity.java:1565)
	at <redacted>(unknown:5)
	at android.app.Activity.performCreate(Activity.java:7994)
	at android.app.Activity.performCreate(Activity.java:7978)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1548)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3406)

It is not a fault of SDK per se, and probably it is some very rare/weird situation, but we can add a guard by checking the result of Activity.getIntent().

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm
0xnm requested review from a team as code owners September 15, 2025 08:33
@codecov-commenter

codecov-commenter commented Sep 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.54%. Comparing base (ccf1b86) to head (6dcc3f2).
⚠️ Report is 1470 commits behind head on develop.

Files with missing lines Patch % Lines
.../rum/tracking/ActivityLifecycleTrackingStrategy.kt 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2877      +/-   ##
===========================================
+ Coverage    70.49%   70.54%   +0.05%     
===========================================
  Files          809      809              
  Lines        29482    29487       +5     
  Branches      5054     5056       +2     
===========================================
+ Hits         20782    20799      +17     
+ Misses        7275     7263      -12     
  Partials      1425     1425              
Files with missing lines Coverage Δ
...droid/rum/tracking/ActivityViewTrackingStrategy.kt 87.27% <100.00%> (+0.73%) ⬆️
.../rum/tracking/ActivityLifecycleTrackingStrategy.kt 85.71% <80.00%> (+1.10%) ⬆️

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xnm
0xnm merged commit be780c5 into develop Sep 16, 2025
26 checks passed
@0xnm
0xnm deleted the nogorodnikov/rum-11716/check-for-activity.intent-result branch September 16, 2025 07:35
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.

3 participants