MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / closeSession

Function closeSession

packages/core/src/session.ts:120–129  ·  view source on GitHub ↗
(session: Session, status?: Exclude<SessionStatus, 'ok'>)

Source from the content-addressed store, hash-verified

118 * it is changed to `'exited'`.
119 */
120export function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {
121 let context = {};
122 if (status) {
123 context = { status };
124 } else if (session.status === 'ok') {
125 context = { status: 'exited' };
126 }
127
128 updateSession(session, context);
129}
130
131/**
132 * Serializes a passed session object to a JSON object with a slightly different structure.

Callers 3

session.test.tsFile · 0.90
endSessionFunction · 0.90
endSessionFunction · 0.90

Calls 1

updateSessionFunction · 0.85

Tested by

no test coverage detected