🔧 Filter out more known errors/message from Sentry
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
Daily database cleanup / clean (push) Has been cancelled
Check and report chats usage / send (push) Has been cancelled

This commit is contained in:
Baptiste Arnaud 2025-02-17 15:43:17 +01:00
parent bbb90b529b
commit fcef3da442
No known key found for this signature in database
3 changed files with 49 additions and 0 deletions

View File

@ -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) =>

View File

@ -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"

View File

@ -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();