Avoid logging initial null viewLoadingTime on first call to addViewLoadingTime#2517
Merged
sbarrio merged 1 commit intoFeb 28, 2025
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
|
maciejburda
approved these changes
Feb 28, 2025
sbarrio
marked this pull request as ready for review
February 28, 2025 11:47
0xnm
approved these changes
Feb 28, 2025
sbarrio
deleted the
sbarrio/fix-logging-null-on-add-view-loading-time-first-call
branch
February 28, 2025 13:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
newLoadingTimeinstead ofviewLoadingTime.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 Maininstead of:
[_dd.sdk_core.default]: View loading time 525.0829529762268ns added to the view MainAdditional Notes
Found this while testing the implementation of https://datadoghq.atlassian.net/browse/RUM-6479
Review checklist (to be filled by reviewers)