Skip to content

Commit 43465c1

Browse files
authored
fix Typescript errors (#7261)
fix: Typescript errors
1 parent c10389c commit 43465c1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

core/util/sentry/SentryLogger.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Extras } from "@sentry/core";
1+
import { Extras, type Integration, type Event } from "@sentry/core";
22
import * as Sentry from "@sentry/node";
33
import os from "node:os";
44
import { IdeInfo } from "../../index.js";
@@ -25,7 +25,7 @@ export class SentryLogger {
2525

2626
// Filter integrations that use the global variable
2727
const integrations = Sentry.getDefaultIntegrations({}).filter(
28-
(defaultIntegration) => {
28+
(defaultIntegration: Integration) => {
2929
// Remove integrations that might interfere with shared environments
3030
return ![
3131
"OnUncaughtException",
@@ -52,7 +52,7 @@ export class SentryLogger {
5252
sendDefaultPii: false,
5353

5454
// Strip sensitive data and add basic properties before sending events
55-
beforeSend(event) {
55+
beforeSend(event: Event) {
5656
// First apply anonymization
5757
const anonymizedEvent = anonymizeSentryEvent(event);
5858
if (!anonymizedEvent) return null;
@@ -197,7 +197,7 @@ export function createSpan<T>(
197197
}
198198

199199
// Use withScope from Sentry to isolate the span context
200-
return Sentry.withScope((isolatedScope) => {
200+
return Sentry.withScope((isolatedScope: Sentry.Scope) => {
201201
isolatedScope.setClient(client);
202202
return Sentry.startSpan(
203203
{

core/util/sentry/anonymization.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ErrorEvent } from "@sentry/core";
1+
import * as Sentry from "@sentry/node";
2+
import { type Event } from "@sentry/core";
23
/**
34
* Minimalist Sentry anonymization utilities
45
*/
@@ -75,7 +76,7 @@ export function anonymizeUserInfo(user: any): any {
7576
/**
7677
* Main anonymization function - minimalist approach like Rasa
7778
*/
78-
export function anonymizeSentryEvent(event: ErrorEvent): any | null {
79+
export function anonymizeSentryEvent(event: any): any | null {
7980
try {
8081
// Deep copy to avoid mutating the original event
8182
const anonymized = structuredClone(event);

gui/src/hooks/TelemetryProviders.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => {
5959
sendDefaultPii: false,
6060

6161
// Strip sensitive data and add basic properties
62-
beforeSend(event) {
62+
beforeSend(event: Sentry.Event) {
6363
// Apply comprehensive anonymization using shared logic
6464
const anonymizedEvent = anonymizeSentryEvent(event);
6565
if (!anonymizedEvent) return null;

0 commit comments

Comments
 (0)