Skip to content

Commit 2fbd61e

Browse files
committed
fix: Init timestamp and started with same value
1 parent 042e20e commit 2fbd61e

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

packages/browser/src/client.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
5757
});
5858
}
5959

60-
/**
61-
* @inheritDoc
62-
*/
63-
public captureSession(session: Session): void {
64-
// Make sure session duration is not sent
65-
session.duration = undefined;
66-
super.captureSession(session);
67-
}
68-
6960
/**
7061
* @inheritDoc
7162
*/

packages/hub/src/session.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export class Session implements SessionInterface {
2121
public release?: string;
2222
public sid: string = uuid4();
2323
public did?: string;
24-
public timestamp: number = timestampInSeconds();
25-
public started: number = timestampInSeconds();
24+
public timestamp: number;
25+
public started: number;
2626
public duration?: number = 0;
2727
public status: SessionStatus = SessionStatus.Ok;
2828
public environment?: string;
@@ -31,6 +31,9 @@ export class Session implements SessionInterface {
3131
public browser: boolean = false;
3232

3333
public constructor(context?: Omit<SessionContext, 'started' | 'status'>) {
34+
const startingTime = timestampInSeconds();
35+
this.timestamp = startingTime;
36+
this.started = startingTime;
3437
if (context) {
3538
this.update(context);
3639
}

0 commit comments

Comments
 (0)