From 8da881f3213299dfd203935a247ab59f80542557 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 14 Apr 2026 11:26:40 +0100 Subject: [PATCH] remove sentry --- package.json | 4 -- src/app/app.module.ts | 44 ------------------- .../api-validate-schema.decorator.ts | 10 ++--- .../socket-validate-schema.decorator.ts | 1 - .../services/file/file-validator.service.ts | 10 ++--- src/app/utils/sentryErrorInterface.ts | 1 - src/main.ts | 18 -------- 7 files changed, 10 insertions(+), 78 deletions(-) diff --git a/package.json b/package.json index 9a138bf14..af8de9afd 100644 --- a/package.json +++ b/package.json @@ -128,10 +128,6 @@ "@opentelemetry/sdk-trace-web": "^1.25.1", "@opentelemetry/semantic-conventions": "^1.25.1", "@pdftron/pdfjs-express": "^8.0.1", - "@sentry/angular": "^7.73.0", - "@sentry/capacitor": "^0.14.0", - "@sentry/cli": "^2.33.1", - "@sentry/tracing": "^7.114.0", "@teamhive/capacitor-video-recorder": "^5.0.0", "@tinymce/tinymce-angular": "^4.2.4", "@types/jest-environment-puppeteer": "^5.0.3", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3ee387611..2f9bd6c0b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -66,7 +66,6 @@ import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { MatInputModule } from '@angular/material/input'; import { MatNativeDateModule } from '@angular/material/core'; -import * as SentrySibling from '@sentry/angular'; import { AngularFireModule } from '@angular/fire'; import { AngularFireMessagingModule } from '@angular/fire/messaging'; import { firebaseConfig } from '../firebase-config'; @@ -92,49 +91,6 @@ import { SessionExpiredModalPageModule } from './modals/session-expired-modal/se import { Logger } from './services/logger/main/service'; registerLocaleData(localePt, 'pt'); -// import * as Sentry from '@sentry/capacitor'; -// import { Integration } from '@sentry/types'; -// import { BrowserTracing } from '@sentry/tracing'; -// import { LogsDatabase } from './infra/database/dexie/instance/logs/service'; -// import { AppErrorHandler } from './infra/crash-analytics/app-error-handler'; - - - -// Sentry.init( -// { -// dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', -// // To set your release and dist versions -// release: 'gabinetedigital@1.0.0', -// dist: '1', -// // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. -// // We recommend adjusting this value in production. -// tracesSampleRate: 1.0, -// debug: true, // logs to console -// beforeSend(event) { -// console.log('event.exception.values[0].value', event.exception.values[0].value); - -// if (event.level === 'error') { - -// LogsDatabase.sentryError.add(event as any).then(() => { -// console.log('event', event) -// }) - -// // openTelemetryLogging.send({ -// // level: 'info', -// // message: event.exception.values[0].value, -// // payload: { -// // object: { -// // sentry: true, -// // error: event -// // } -// // }, -// // }) -// } -// // Return event to send it to Sentry -// return event; -// }, -// } -// ); (function () { diff --git a/src/app/services/decorators/api-validate-schema.decorator.ts b/src/app/services/decorators/api-validate-schema.decorator.ts index f2990a1a3..50021504e 100644 --- a/src/app/services/decorators/api-validate-schema.decorator.ts +++ b/src/app/services/decorators/api-validate-schema.decorator.ts @@ -23,11 +23,11 @@ export function APIReturn(schema: z.ZodTypeAny, context: string) { ColoredLoggerService.error(error.errors, 'API unexpected data structure '+ context) console.error(result.value) // Capture the Zod validation error with additional context - Sentry.withScope((scope) => { - scope.setTag('APIReturn', 'user'); - scope.setContext('data', { data: result.value }); - Sentry.captureException(error); - }); + // Sentry.withScope((scope) => { + // scope.setTag('APIReturn', 'user'); + // scope.setContext('data', { data: result.value }); + // Sentry.captureException(error); + // }); } else { console.log('failed to setup the connection successful') diff --git a/src/app/services/decorators/socket-validate-schema.decorator.ts b/src/app/services/decorators/socket-validate-schema.decorator.ts index 4ca6e1504..e3644d2c4 100644 --- a/src/app/services/decorators/socket-validate-schema.decorator.ts +++ b/src/app/services/decorators/socket-validate-schema.decorator.ts @@ -1,7 +1,6 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Result } from 'neverthrow'; import { z, ZodError } from 'zod'; -import * as Sentry from '@sentry/capacitor'; import { ColoredLoggerService } from '../logger/colored/service'; export function SocketStreamReturn(schema: z.ZodTypeAny, context: string) { diff --git a/src/app/services/file/file-validator.service.ts b/src/app/services/file/file-validator.service.ts index d0cc07d27..0b707fb89 100644 --- a/src/app/services/file/file-validator.service.ts +++ b/src/app/services/file/file-validator.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Either, error, ok} from "src/app/services/Either" -import * as Sentry from '@sentry/capacitor'; + @Injectable({ providedIn: 'root' @@ -69,7 +69,7 @@ export class FileValidatorService { imageDiv.onerror = (e: Event) => { resolve(error(e)) - Sentry.captureMessage('FileValidatorService invalid image content'); + //Sentry.captureMessage('FileValidatorService invalid image content'); } imageDiv.src = base64Image @@ -92,7 +92,7 @@ export class FileValidatorService { videoElement.addEventListener('error', () => { resolve(ok(true)) - Sentry.captureMessage('FileValidatorService invalid video content'); + //Sentry.captureMessage('FileValidatorService invalid video content'); }); }) @@ -113,7 +113,7 @@ export class FileValidatorService { videoElement.addEventListener('error', () => { resolve(ok(true)) - Sentry.captureMessage('FileValidatorService invalid video content'); + //Sentry.captureMessage('FileValidatorService invalid video content'); }); }) @@ -152,7 +152,7 @@ export class FileValidatorService { if(a) { return ok(true) } else { - Sentry.captureMessage('FileValidatorService invalid filename '+ filename); + //Sentry.captureMessage('FileValidatorService invalid filename '+ filename); return error(false) } } diff --git a/src/app/utils/sentryErrorInterface.ts b/src/app/utils/sentryErrorInterface.ts index 8afde7df2..e69de29bb 100644 --- a/src/app/utils/sentryErrorInterface.ts +++ b/src/app/utils/sentryErrorInterface.ts @@ -1 +0,0 @@ -import { Event } from '@sentry/types/types/event'; diff --git a/src/main.ts b/src/main.ts index dd1898ef8..25c045faf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,24 +16,6 @@ import 'src/app/services/monitoring/opentelemetry/matrix'; if (environment.production) { enableProdMode(); } -/* Sentry.init( - { - dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', - // To set your release and dist versions - release: 'gabinetedigital@1.0.0', - dist: '1', - // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. - // We recommend adjusting this value in production. - integrations: [ - new BrowserTracing({ - tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], - }) as Integration, - ] - }, - // Forward the init method to the sibling Framework. - SentrySibling.init -); */ - platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err));