Skip to content

Commit

Permalink
chore: make mark exist before subtracting time
Browse files Browse the repository at this point in the history
  • Loading branch information
devcorpio committed Jul 28, 2023
1 parent 3f852a0 commit 82e7b8b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/rum-core/src/performance-monitoring/navigation/marks.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ function getNavigationTimingMarks(timing) {
const marks = {}
NAVIGATION_TIMING_MARKS.forEach(function (timingKey) {
const m = timing[timingKey]
if (isRedirectInfoAvailable(timing)) {
marks[timingKey] = parseInt(m - redirectStart)
} else if (m && m >= fetchStart) {
marks[timingKey] = parseInt(m - fetchStart)
if (m && m >= fetchStart) {
if (isRedirectInfoAvailable(timing)) {
// make sure navigation marks will show up after the Redirect span
marks[timingKey] = parseInt(m - redirectStart)
} else {
marks[timingKey] = parseInt(m - fetchStart)
}
}
})
return marks
Expand Down

0 comments on commit 82e7b8b

Please sign in to comment.