mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 10:53:01 +00:00
Drop @sentry/node (Sentry support) - untested and unused
This commit is contained in:
1 parent
3a0bded7f2
commit
0c3d8a792f
14 files changed
+3
-210
No files matched your search
@@ -24,7 +24,6 @@ import {
|
||||
Config,
|
||||
initDatabase,
|
||||
initEvent,
|
||||
Sentry,
|
||||
} from "@spacebar/util";
|
||||
import ws from "ws";
|
||||
import { Connection } from "./events/Connection";
|
||||
@@ -74,7 +73,6 @@ export class Server {
|
||||
await initDatabase();
|
||||
await Config.init();
|
||||
await initEvent();
|
||||
await Sentry.init();
|
||||
// temporary fix
|
||||
await cleanupOnStartup();
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import * as Sentry from "@sentry/node";
|
||||
import { CLOSECODES, OPCODES, Payload, WebSocket } from "@spacebar/gateway";
|
||||
import { ErlpackType, PayloadSchema } from "@spacebar/util";
|
||||
import fs from "fs/promises";
|
||||
@@ -25,6 +24,7 @@ import path from "path";
|
||||
import WS from "ws";
|
||||
import OPCodeHandlers from "../opcodes";
|
||||
import { check } from "../opcodes/instanceOf";
|
||||
|
||||
const bigIntJson = BigIntJson({ storeAsString: true });
|
||||
|
||||
let erlpack: ErlpackType | null = null;
|
||||
@@ -89,29 +89,8 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
||||
}
|
||||
|
||||
try {
|
||||
return await Sentry.startSpan(
|
||||
// Emma [it/its]@Rory&: is this the right function to migrate to in v8?
|
||||
{
|
||||
op: "websocket.server",
|
||||
name: `GATEWAY ${OPCODES[data.op]}`,
|
||||
attributes: {
|
||||
// this needs to be reworked :)
|
||||
...data.d,
|
||||
token: data?.d?.token ? "[Redacted]" : undefined,
|
||||
},
|
||||
},
|
||||
async () => {
|
||||
const ret = await OPCodeHandler.call(this, data);
|
||||
Sentry.setUser({ id: this.user_id });
|
||||
return ret;
|
||||
},
|
||||
);
|
||||
return await OPCodeHandler.call(this, data);
|
||||
} catch (error) {
|
||||
Sentry.captureException(error, {
|
||||
user: {
|
||||
id: this.user_id,
|
||||
},
|
||||
});
|
||||
console.error(`Error: Op ${data.op}`, error);
|
||||
// if (!this.CLOSED && this.CLOSING)
|
||||
return this.close(CLOSECODES.Unknown_error);
|
||||
|
||||
Reference in new issue
Block a user