Skip to content

Avoid logging initial null viewLoadingTime on first call to addViewLoadingTime#2517

Merged
sbarrio merged 1 commit into
developfrom
sbarrio/fix-logging-null-on-add-view-loading-time-first-call
Feb 28, 2025
Merged

Avoid logging initial null viewLoadingTime on first call to addViewLoadingTime#2517
sbarrio merged 1 commit into
developfrom
sbarrio/fix-logging-null-on-add-view-loading-time-first-call

Conversation

@sbarrio

@sbarrio sbarrio commented Feb 28, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR aims to fix and match the behaviour of the first call made to addViewLoadingTime, so it properly logs the newLoadingTime that it has just calculated and that it will use to set viewLoadingTime to just a few lines after this log is registered.

The change is as simple as changing the log call to use newLoadingTime instead of viewLoadingTime.

Motivation

This change is done so both Android and iOS SDKs behave in the same way, and also so the SDK avoids logging the initial null value of viewLoadingTime, which may confuse users into thinking that there's something wrong by logging a message like:

[_dd.sdk_core.default]: View loading time nullns added to the view Main

instead of:

[_dd.sdk_core.default]: View loading time 525.0829529762268ns added to the view Main

Additional Notes

Found this while testing the implementation of https://datadoghq.atlassian.net/browse/RUM-6479

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)

@sbarrio sbarrio changed the title Fix avoid logging initial null viewLoadingTime on first call to addViewLoading Fix avoid logging initial null viewLoadingTime on first call to addViewLoadingTime Feb 28, 2025
@sbarrio sbarrio changed the title Fix avoid logging initial null viewLoadingTime on first call to addViewLoadingTime Fix - avoid logging initial null viewLoadingTime on first call to addViewLoadingTime Feb 28, 2025
@sbarrio sbarrio changed the title Fix - avoid logging initial null viewLoadingTime on first call to addViewLoadingTime Avoid logging initial null viewLoadingTime on first call to addViewLoadingTime Feb 28, 2025
@codecov-commenter

codecov-commenter commented Feb 28, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.04%. Comparing base (c0044da) to head (74ce0ef).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2517      +/-   ##
===========================================
+ Coverage    70.02%   70.04%   +0.02%     
===========================================
  Files          794      794              
  Lines        29875    29875              
  Branches      4991     4991              
===========================================
+ Hits         20917    20924       +7     
+ Misses        7579     7571       -8     
- Partials      1379     1380       +1     
Files with missing lines Coverage Δ
.../android/rum/internal/domain/scope/RumViewScope.kt 95.16% <100.00%> (ø)

... and 28 files with indirect coverage changes

@sbarrio
sbarrio marked this pull request as ready for review February 28, 2025 11:47
@sbarrio
sbarrio requested review from a team as code owners February 28, 2025 11:47
@sbarrio
sbarrio merged commit 3238970 into develop Feb 28, 2025
@sbarrio
sbarrio deleted the sbarrio/fix-logging-null-on-add-view-loading-time-first-call branch February 28, 2025 13:19
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