diff --git a/apps/viewer/sentry.server.config.ts b/apps/viewer/sentry.server.config.ts index b9a2d92aa..c430975ac 100644 --- a/apps/viewer/sentry.server.config.ts +++ b/apps/viewer/sentry.server.config.ts @@ -7,6 +7,15 @@ const ignoreTrpcMessages = [ "timeout reached", "Missing startParams", "need to be authenticated to perform this action", + "current block does not expect file upload", + "couldn't find credentials in database", + "start group doesn't exist", +]; + +const ignoreMessages = [ + "could not find credentials", + "is in reply state", + "point to another phone ID", ]; Sentry.init({ @@ -15,6 +24,13 @@ Sentry.init({ tracesSampleRate: 1, beforeSend: (event, hint) => { const exception = hint.originalException; + if ( + typeof exception === "string" && + ignoreMessages.some((message) => + exception.toLowerCase().includes(message.toLowerCase()), + ) + ) + return null; if (isTrpcError(exception)) { if ( ignoreTrpcMessages.some((message) => diff --git a/packages/scripts/package.json b/packages/scripts/package.json index be3d5c015..daad4e647 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -27,6 +27,7 @@ "exportResults": "tsx src/exportResults.ts", "updateUserEmail": "SKIP_ENV_CHECK=true dotenv -e ./.env.production -- tsx src/updateUserEmail.ts", "inspectChatSession": "tsx src/inspectChatSession.ts", + "inspectCredentials": "tsx src/inspectCredentials.ts", "deleteChatSession": "tsx src/deleteChatSession.ts", "checkDependencies": "tsx src/checkDependencies.ts", "readCsvAndDoSomething": "SKIP_ENV_CHECK=true dotenv -e ./.env.production -- tsx src/readCsvAndDoSomething.ts" diff --git a/packages/scripts/src/inspectCredentials.ts b/packages/scripts/src/inspectCredentials.ts new file mode 100644 index 000000000..82b2056e2 --- /dev/null +++ b/packages/scripts/src/inspectCredentials.ts @@ -0,0 +1,32 @@ +import * as p from "@clack/prompts"; +import prisma from "@typebot.io/prisma"; +import { promptAndSetEnvironment } from "./utils"; + +const inspectCredentials = async () => { + await promptAndSetEnvironment("production"); + + const id = await p.text({ + message: "Credentials ID?", + }); + + if (!id || typeof id !== "string") { + console.log("No ID provided"); + return; + } + + const credentials = await prisma.credentials.findFirst({ + where: { + id, + }, + select: { + name: true, + workspaceId: true, + }, + }); + + console.log({ + credentials, + }); +}; + +inspectCredentials();