Skip to content

RUM-2485 Provide the parent container information for browser rum events#1831

Merged
mariusc83 merged 1 commit into
feature/sr-web-view-supportfrom
mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events
Feb 1, 2024
Merged

RUM-2485 Provide the parent container information for browser rum events#1831
mariusc83 merged 1 commit into
feature/sr-web-view-supportfrom
mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events

Conversation

@mariusc83

Copy link
Copy Markdown
Member

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

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)

@mariusc83 mariusc83 self-assigned this Jan 19, 2024
@mariusc83
mariusc83 force-pushed the mconstantin/rum-2875/propagate-feature-context-update-through-msb branch 2 times, most recently from 4ba06aa to 0011b35 Compare January 19, 2024 16:44
private fun resolveRumFeature(sdkCore: FeatureSdkCore): WebViewRumFeature? {
(
sdkCore.getFeature(WebViewRumFeature.WEB_RUM_FEATURE_NAME)
?.unwrap<StorageBackedFeature>() as? WebViewRumFeature

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.

Is there a particular reason for doing ?.unwrap<StorageBackedFeature>() as? WebViewRumFeature instead of the ?.unwrap<WebViewRumFeature>()? Same for the similar calls below.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh...nope I think I did that just because I've seen it that way in another place. Better how you suggested

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I found the explanation why, is because in the core we are force casting it, we are not using as? :

    override fun <T : Feature> unwrap(): T = wrappedFeature as T

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.

but it is us who is owning implementation anyway, so we if got the scope for the feature, we can safely unwrap with using as under the hood.

}

private fun addToCache(
entry: Triple<String, Long, Boolean>

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.

I would suggest to create a dedicated class maybe for that.

@mariusc83
mariusc83 force-pushed the mconstantin/rum-2875/propagate-feature-context-update-through-msb branch 2 times, most recently from 6869dff to 474b8b0 Compare January 29, 2024 09:10
@mariusc83
mariusc83 force-pushed the mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events branch from 392479d to 5a770f1 Compare January 29, 2024 09:26
@codecov-commenter

codecov-commenter commented Jan 29, 2024

Copy link
Copy Markdown

Codecov Report

Merging #1831 (688c2a7) into feature/sr-web-view-support (2470aa7) will decrease coverage by 0.01%.
The diff coverage is 87.38%.

Additional details and impacted files
@@                       Coverage Diff                       @@
##           feature/sr-web-view-support    #1831      +/-   ##
===============================================================
- Coverage                        83.69%   83.68%   -0.01%     
===============================================================
  Files                              472      473       +1     
  Lines                            16615    16706      +91     
  Branches                          2504     2533      +29     
===============================================================
+ Hits                             13905    13979      +74     
- Misses                            2015     2019       +4     
- Partials                           695      708      +13     
Files Coverage Δ
...lin/com/datadog/android/rum/internal/RumFeature.kt 93.16% <ø> (+0.65%) ⬆️
.../datadog/android/rum/internal/domain/RumContext.kt 100.00% <100.00%> (ø)
.../android/rum/internal/domain/scope/RumViewScope.kt 93.96% <100.00%> (+0.64%) ⬆️
...id/webview/internal/rum/WebViewRumEventConsumer.kt 90.38% <100.00%> (ø)
...roid/webview/internal/rum/WebViewRumEventMapper.kt 100.00% <100.00%> (ø)
.../android/webview/internal/rum/WebViewRumFeature.kt 100.00% <100.00%> (ø)
.../internal/rum/domain/WebViewNativeRumViewsCache.kt 95.35% <95.35%> (ø)
...lin/com/datadog/android/webview/WebViewTracking.kt 84.54% <21.43%> (-10.64%) ⬇️

... and 28 files with indirect coverage changes

Base automatically changed from mconstantin/rum-2875/propagate-feature-context-update-through-msb to feature/sr-web-view-support January 30, 2024 07:57
@mariusc83
mariusc83 force-pushed the mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events branch 3 times, most recently from 0734db6 to 527454f Compare January 30, 2024 09:51
@mariusc83
mariusc83 marked this pull request as ready for review January 30, 2024 10:13
@mariusc83
mariusc83 requested review from a team as code owners January 30, 2024 10:13
xgouchet
xgouchet previously approved these changes Jan 30, 2024
@mariusc83
mariusc83 force-pushed the mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events branch 3 times, most recently from 243ea1e to 952e57a Compare January 31, 2024 15:41
@mariusc83
mariusc83 force-pushed the mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events branch from 952e57a to 688c2a7 Compare January 31, 2024 16:06
@mariusc83
mariusc83 merged commit fce374b into feature/sr-web-view-support Feb 1, 2024
@mariusc83
mariusc83 deleted the mconstantin/rum-2485/provide-the-container-data-into-browser-rum-events branch February 1, 2024 13:59
@xgouchet xgouchet added this to the 2.8.x milestone Apr 5, 2024
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.

4 participants