Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/blue-jars-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@spotlightjs/spotlight': patch
'@spotlightjs/electron': patch
'@spotlightjs/overlay': patch
'@spotlightjs/astro': patch
---

Fix some typing issues in sentryDataCache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Envelope } from '@sentry/types';
import type { Envelope } from '@sentry/core';
import { CONTEXT_LINES_ENDPOINT } from '@spotlightjs/sidecar/constants';
import { DEFAULT_SIDECAR_URL } from '~/constants';
import type { RawEventContext } from '~/integrations/integration';
Expand Down Expand Up @@ -73,7 +73,7 @@ class SentryDataCache {
const lastSeen = new Date(header.sent_at as string).getTime();
let sdk: Sdk;

if (header.sdk && header.sdk.name && header.sdk.version) {
if (header.sdk?.name && header.sdk.version) {
sdk = {
name: header.sdk.name,
version: header.sdk.version,
Expand Down Expand Up @@ -139,7 +139,7 @@ class SentryDataCache {
const startTs = event.start_timestamp ? event.start_timestamp : new Date().getTime();
const trace = existingTrace ?? {
...traceCtx,
spans: [] as Span[],
spans: new Map(),
transactions: [] as SentryTransactionEvent[],
errors: 0,
timestamp: event.timestamp,
Expand Down Expand Up @@ -324,5 +324,5 @@ class SentryDataCache {
export default new SentryDataCache();

function isErrorEvent(event: SentryEvent): event is SentryErrorEvent {
return event.type != 'transaction';
return event.type !== 'transaction';
}