fix: sentry version

This commit is contained in:
Davidson Gomes 2024-09-03 16:53:23 -03:00
parent 73727da867
commit 849d5f79dc
5 changed files with 16 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Evolution Manager</title>
<script type="module" crossorigin src="/assets/index-7AslllZb.js"></script>
<script type="module" crossorigin src="/assets/index-B-Bdu2zN.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DNOCacL_.css">
</head>
<body>

View File

@ -52,8 +52,8 @@
"@figuro/chatwoot-sdk": "^1.1.16",
"@hapi/boom": "^10.0.1",
"@prisma/client": "^5.15.0",
"@sentry/node": "^7.119.0",
"@sentry/profiling-node": "^8.26.0",
"@sentry/node": "^8.28.0",
"@sentry/profiling-node": "^8.28.0",
"amqplib": "^0.10.3",
"axios": "^1.6.5",
"baileys": "6.7.7",

View File

@ -8,6 +8,7 @@ import { Events, wa } from '@api/types/wa.types';
import { Chatwoot, ConfigService, Openai } from '@config/env.config';
import { BadRequestException, InternalServerErrorException } from '@exceptions';
import EventEmitter2 from 'eventemitter2';
import { v4 } from 'uuid';
export class EvolutionStartupService extends ChannelStartupService {
constructor(
@ -92,7 +93,7 @@ export class EvolutionStartupService extends ChannelStartupService {
if (received.message) {
const key = {
id: received.key.id,
id: received.key.id || v4(),
remoteJid: received.key.remoteJid,
fromMe: received.key.fromMe,
};
@ -162,7 +163,7 @@ export class EvolutionStartupService extends ChannelStartupService {
await this.updateContact({
remoteJid: messageRaw.key.remoteJid,
pushName: messageRaw.pushName,
profilePicUrl: null,
profilePicUrl: received.profilePicUrl,
});
}
} catch (error) {
@ -268,8 +269,10 @@ export class EvolutionStartupService extends ChannelStartupService {
webhookUrl = options.webhookUrl;
}
const messageId = v4();
const messageRaw: any = {
key: { fromMe: true, id: 'ID', remoteJid: number },
key: { fromMe: true, id: messageId, remoteJid: number },
message: {
...message,
quoted,

View File

@ -7,6 +7,7 @@ import { onUnexpectedError } from '@config/error.config';
import { Logger } from '@config/logger.config';
import { ROOT_DIR } from '@config/path.config';
import * as Sentry from '@sentry/node';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
import { ServerUP } from '@utils/server-up';
import axios from 'axios';
import compression from 'compression';
@ -29,10 +30,11 @@ async function bootstrap() {
dsn: dsn,
environment: process.env.NODE_ENV || 'development',
tracesSampleRate: 1.0,
integrations: [nodeProfilingIntegration()],
profilesSampleRate: 1.0,
});
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
app.use(Sentry.Handlers.errorHandler());
Sentry.setupExpressErrorHandler(app);
}
let providerFiles: ProviderFiles = null;