Skip to content

Commit 50f6bd4

Browse files
authored
fix: errors not being logged into the database (@fehmer) (monkeytypegame#6323)
!nuf
1 parent 12ab49c commit 50f6bd4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

backend/src/middlewares/error.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import {
1111
recordServerErrorByVersion,
1212
} from "../utils/prometheus";
1313
import { isDevEnvironment } from "../utils/misc";
14-
import { ObjectId } from "mongodb";
1514
import { version } from "../version";
1615
import { addLog } from "../dal/logs";
1716
import { ExpressRequestWithContext } from "../api/types";
1817

1918
type DBError = {
20-
_id: ObjectId;
19+
_id: string; //we are using uuid here, not objectIds
2120
timestamp: number;
2221
status: number;
2322
uid: string;
@@ -81,7 +80,7 @@ async function errorHandlingMiddleware(
8180
uid
8281
);
8382
await db.collection<DBError>("errors").insertOne({
84-
_id: new ObjectId(errorId),
83+
_id: errorId,
8584
timestamp: Date.now(),
8685
status: status,
8786
uid,

0 commit comments

Comments
 (0)