From 0c3d8a792f9f17f2f28ad449cd8bc5c2a381c8d5 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 29 Sep 2025 21:28:06 +0200 Subject: Drop @sentry/node (Sentry support) - untested and unused --- src/api/Server.ts | 4 ---- src/api/middlewares/Authentication.ts | 3 --- src/api/util/handlers/Message.ts | 7 ------- 3 files changed, 14 deletions(-) (limited to 'src/api') diff --git a/src/api/Server.ts b/src/api/Server.ts index 910e3496a..3db2e6e24 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -22,7 +22,6 @@ import { ConnectionLoader, Email, JSONReplacer, - Sentry, WebAuthn, initDatabase, initEvent, @@ -80,7 +79,6 @@ export class SpacebarServer extends Server { await Email.init(); await ConnectionConfig.init(); await initInstance(); - await Sentry.init(this.app); WebAuthn.init(); const logRequests = process.env["LOG_REQUESTS"] != undefined; @@ -157,8 +155,6 @@ export class SpacebarServer extends Server { this.app.use(ErrorHandler); - Sentry.errorHandler(this.app); - ConnectionLoader.loadConnections(); if (logRequests) diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts index b297a40c1..987493f95 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts @@ -16,7 +16,6 @@ along with this program. If not, see . */ -import * as Sentry from "@sentry/node"; import { checkToken, Rights } from "@spacebar/util"; import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; @@ -108,8 +107,6 @@ export async function Authentication( if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401)); - Sentry.setUser({ id: req.user_id }); - try { const { decoded, user } = await checkToken(req.headers.authorization); diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 1422702d0..8356ee618 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -16,7 +16,6 @@ along with this program. If not, see . */ -import * as Sentry from "@sentry/node"; import { EmbedHandlers } from "@spacebar/api"; import { Application, @@ -422,12 +421,6 @@ export async function postHandleMessage(message: Message) { } } catch (e) { console.error(`[Embeds] Error while generating embed for ${link}`, e); - Sentry.captureException(e, (scope) => { - scope.clear(); - scope.setContext("request", { url: link }); - return scope; - }); - continue; } } -- cgit 1.5.1