Skip to content

RUM-6104 ensure UploadWorker uses the sdk instance name#2257

Merged
xgouchet merged 2 commits into
developfrom
xgouchet/RUM-6104/upload_worker_instance_name
Sep 11, 2024
Merged

RUM-6104 ensure UploadWorker uses the sdk instance name#2257
xgouchet merged 2 commits into
developfrom
xgouchet/RUM-6104/upload_worker_instance_name

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

When the UploadWorker is woken by the system, it reads the SDK Instance name from the WorkRequest input data, and tries to get the instance with that name.

However, the instance name was never sent meaning that for applications specifying an instance name would never find a relevant SDK.

Motivation

Fixes #2252

@xgouchet
xgouchet requested review from a team as code owners September 11, 2024 07:25
@codecov-commenter

codecov-commenter commented Sep 11, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.97%. Comparing base (908b45a) to head (cefc19c).
Report is 20 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2257      +/-   ##
===========================================
- Coverage    69.98%   69.97%   -0.01%     
===========================================
  Files          728      728              
  Lines        27063    27051      -12     
  Branches      4561     4560       -1     
===========================================
- Hits         18939    18927      -12     
- Misses        6841     6846       +5     
+ Partials      1283     1278       -5     
Files with missing lines Coverage Δ
...n/com/datadog/android/core/internal/DatadogCore.kt 81.90% <100.00%> (+0.08%) ⬆️
...ore/internal/lifecycle/ProcessLifecycleCallback.kt 90.00% <100.00%> (+1.11%) ⬆️
...og/android/core/internal/utils/WorkManagerUtils.kt 91.18% <100.00%> (+0.27%) ⬆️
.../android/error/internal/DatadogExceptionHandler.kt 87.84% <100.00%> (ø)

... and 33 files with indirect coverage changes

assertThat(testedCore.isDeveloperModeEnabled).isFalse()
}

@RepeatedTest(128)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be just @Test here? Is it needed to repeat it so many times?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, i used it locally :D

@ambushwork

Copy link
Copy Markdown
Member

Question: in the description of the PR it says before the fix, ".. meaning that for applications specifying an instance name would never find a relevant SDK." I wonder how UploadWorker can work correctly after a while of application running?

@xgouchet
xgouchet force-pushed the xgouchet/RUM-6104/upload_worker_instance_name branch from 7bcbc27 to cefc19c Compare September 11, 2024 09:05
@xgouchet
xgouchet merged commit 72adfba into develop Sep 11, 2024
@xgouchet
xgouchet deleted the xgouchet/RUM-6104/upload_worker_instance_name branch September 11, 2024 11:39
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.

How can i populate DATADOG_INSTANCE_NAME in UploadWorker.kt?

5 participants