-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[main] fix startTime timestamp #2183
Conversation
} else { | ||
// calculate the start time manually | ||
let duration = ((customProperties || pageView.properties || {}).duration || 0); | ||
pageView.startTime = new Date(new Date().getTime() - duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to be done of ALL other cases, otherwise the reported "time" will be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise the Portal will show the wrong "startTime"
pageView.startTime = new Date(perf.timeOrigin + loadEventStart); | ||
} else { | ||
// calculate the start time manually | ||
let duration = ((properties || pageView.properties || {}).duration || 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at all of the "usages" of the sendPageViewInternal
, it looks like (once we remove this from here), that we should do this duration update in the AngularPlugin.ts Line 602
(before the _pageTracking
calls the _self.sendPageViewInternal
so that the "time" is still shifted back by the duration
otherwise the Portal will show the wrong "startTime"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe?? (testing required)
We can just keep something here like
if (isNullOrUndefined(pageView.startTime)) {
// calculate the start time manually
let duration = ((properties || pageView.properties || {}).duration || 0);
if (duration) {
pageView.startTime = new Date(new Date().getTime() - duration);
}
}
So that if the previous code (like the line 602 above) doesn't specify any startTime
then we keep "using" this default, this should also work for the subsequent page views, even with your code below for the if (!firstPageViewSent){
manual test time result: second page view triggered around 3 seconds after: |
only modify the startTime for first page view telemetry