Skip to content

Commit 0869503

Browse files
committed
fixes
1 parent 3347fa5 commit 0869503

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

packages/core/src/utils/spanUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type {
2121
} from '../types-hoist';
2222
import type { SpanLink, SpanLinkJSON } from '../types-hoist/link';
2323
import { consoleSandbox } from '../utils-hoist/logger';
24-
import { addNonEnumerableProperty, dropUndefinedKeys } from '../utils-hoist/object';
24+
import { addNonEnumerableProperty } from '../utils-hoist/object';
2525
import { generateSpanId } from '../utils-hoist/propagationContext';
2626
import { timestampInSeconds } from '../utils-hoist/time';
2727
import { generateSentryTraceHeader } from '../utils-hoist/tracing';

packages/core/test/lib/tracing/dynamicSamplingContext.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
7070
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(rootSpan);
7171

7272
expect(dynamicSamplingContext).toStrictEqual({
73+
public_key: undefined,
7374
release: '1.0.1',
7475
environment: 'production',
7576
sampled: 'true',
@@ -88,6 +89,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
8889
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(rootSpan);
8990

9091
expect(dynamicSamplingContext).toStrictEqual({
92+
public_key: undefined,
9193
release: '1.0.1',
9294
environment: 'production',
9395
sampled: 'true',
@@ -111,6 +113,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
111113
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(rootSpan);
112114

113115
expect(dynamicSamplingContext).toStrictEqual({
116+
public_key: undefined,
114117
release: '1.0.1',
115118
environment: 'production',
116119
sampled: 'true',
@@ -166,6 +169,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
166169
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(rootSpan);
167170

168171
expect(dynamicSamplingContext).toStrictEqual({
172+
public_key: undefined,
169173
release: '1.0.1',
170174
environment: 'production',
171175
trace_id: expect.stringMatching(/^[a-f0-9]{32}$/),

packages/nuxt/src/runtime/utils.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ import type { ComponentPublicInstance } from 'vue';
99
* Extracts the relevant context information from the error context (H3Event in Nitro Error)
1010
* and created a structured context object.
1111
*/
12-
export function extractErrorContext(errorContext: CapturedErrorContext): Context {
13-
if (!errorContext.event) {
14-
return {};
12+
export function extractErrorContext(errorContext: CapturedErrorContext | undefined): Context {
13+
const ctx: Context = {};
14+
15+
if (!errorContext) {
16+
return ctx;
1517
}
1618

17-
return {
18-
method: errorContext.event._method,
19-
path: errorContext.event._path,
20-
tags: Array.isArray(errorContext.tags) ? errorContext.tags : undefined,
21-
};
19+
if (errorContext.event) {
20+
ctx.method = errorContext.event._method;
21+
ctx.path = errorContext.event._path;
22+
}
23+
24+
if (Array.isArray(errorContext.tags)) {
25+
ctx.tags = errorContext.tags;
26+
}
27+
28+
return ctx;
2229
}
2330

2431
/**

packages/replay-internal/src/integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { BrowserClientReplayOptions, Client, Integration, IntegrationFn, ReplayRecordingMode } from '@sentry/core';
2-
import { consoleSandbox, dropUndefinedKeys, isBrowser, parseSampleRate } from '@sentry/core';
2+
import { consoleSandbox, isBrowser, parseSampleRate } from '@sentry/core';
33
import {
44
DEFAULT_FLUSH_MAX_DELAY,
55
DEFAULT_FLUSH_MIN_DELAY,

0 commit comments

Comments
 (0)