Skip to content

Commit 1ffe90f

Browse files
authored
ref: Fix some typing errors in sentryDataCache (#691)
1 parent a6dee82 commit 1ffe90f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.changeset/blue-jars-peel.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@spotlightjs/spotlight': patch
3+
'@spotlightjs/electron': patch
4+
'@spotlightjs/overlay': patch
5+
'@spotlightjs/astro': patch
6+
---
7+
8+
Fix some typing issues in sentryDataCache

packages/overlay/src/integrations/sentry/data/sentryDataCache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Envelope } from '@sentry/types';
1+
import type { Envelope } from '@sentry/core';
22
import { CONTEXT_LINES_ENDPOINT } from '@spotlightjs/sidecar/constants';
33
import { DEFAULT_SIDECAR_URL } from '~/constants';
44
import type { RawEventContext } from '~/integrations/integration';
@@ -73,7 +73,7 @@ class SentryDataCache {
7373
const lastSeen = new Date(header.sent_at as string).getTime();
7474
let sdk: Sdk;
7575

76-
if (header.sdk && header.sdk.name && header.sdk.version) {
76+
if (header.sdk?.name && header.sdk.version) {
7777
sdk = {
7878
name: header.sdk.name,
7979
version: header.sdk.version,
@@ -139,7 +139,7 @@ class SentryDataCache {
139139
const startTs = event.start_timestamp ? event.start_timestamp : new Date().getTime();
140140
const trace = existingTrace ?? {
141141
...traceCtx,
142-
spans: [] as Span[],
142+
spans: new Map(),
143143
transactions: [] as SentryTransactionEvent[],
144144
errors: 0,
145145
timestamp: event.timestamp,
@@ -324,5 +324,5 @@ class SentryDataCache {
324324
export default new SentryDataCache();
325325

326326
function isErrorEvent(event: SentryEvent): event is SentryErrorEvent {
327-
return event.type != 'transaction';
327+
return event.type !== 'transaction';
328328
}

0 commit comments

Comments
 (0)