Skip to content

Commit b5c6777

Browse files
committed
chore: remove CONFIG_SESSION_PHONE_VERSION and update related code
- Removed the CONFIG_SESSION_PHONE_VERSION environment variable from the configuration and Docker files. - Updated the BaileysStartupService to directly fetch the latest WhatsApp Web version without relying on the removed environment variable. - Adjusted the index router to reflect the changes in the WhatsApp Web version retrieval.
1 parent 7f8293f commit b5c6777

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Fix upload to s3 when media message
1616
* Simplify edited message check in BaileysStartupService
1717
* Avoid corrupting URLs with query strings
18+
* Removed CONFIG_SESSION_PHONE_VERSION environment variable
1819

1920
# 2.3.0 (2025-06-17 09:19)
2021

Docker/swarm/evolution_api_v2.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ services:
9494
- WEBHOOK_EVENTS_ERRORS_WEBHOOK=
9595
- CONFIG_SESSION_PHONE_CLIENT=Evolution API V2
9696
- CONFIG_SESSION_PHONE_NAME=Chrome
97-
#- CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200
9897
- QRCODE_LIMIT=30
9998
- OPENAI_ENABLED=true
10099
- DIFY_ENABLED=true

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -549,17 +549,18 @@ export class BaileysStartupService extends ChannelStartupService {
549549
this.logger.info(`Browser: ${browser}`);
550550
}
551551

552-
let version;
553-
let log;
554-
555-
if (session.VERSION) {
556-
version = session.VERSION.split('.');
557-
log = `Baileys version env: ${version}`;
558-
} else {
559-
const baileysVersion = await fetchLatestWaWebVersion({});
560-
version = baileysVersion.version;
561-
log = `Baileys version: ${version}`;
562-
}
552+
const baileysVersion = await fetchLatestWaWebVersion({});
553+
const version = baileysVersion.version;
554+
const log = `Baileys version: ${version.join('.')}`;
555+
556+
// if (session.VERSION) {
557+
// version = session.VERSION.split('.');
558+
// log = `Baileys version env: ${version}`;
559+
// } else {
560+
// const baileysVersion = await fetchLatestWaWebVersion({});
561+
// version = baileysVersion.version;
562+
// log = `Baileys version: ${version}`;
563+
// }
563564

564565
this.logger.info(log);
565566

src/api/routes/index.router.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ router
6969
clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME,
7070
manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined,
7171
documentation: `https://doc.evolution-api.com`,
72-
whatsappWebVersion:
73-
process.env.CONFIG_SESSION_PHONE_VERSION || (await fetchLatestWaWebVersion({})).version.join('.'),
72+
whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'),
7473
});
7574
})
7675
.post('/verify-creds', authGuard['apikey'], async (req, res) => {

src/config/env.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export type Webhook = {
249249
};
250250
};
251251
export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPusher };
252-
export type ConfigSessionPhone = { CLIENT: string; NAME: string; VERSION: string };
252+
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
253253
export type QrCode = { LIMIT: number; COLOR: string };
254254
export type Typebot = { ENABLED: boolean; API_VERSION: string; SEND_MEDIA_BASE64: boolean };
255255
export type Chatwoot = {
@@ -590,7 +590,6 @@ export class ConfigService {
590590
CONFIG_SESSION_PHONE: {
591591
CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API',
592592
NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome',
593-
VERSION: process.env?.CONFIG_SESSION_PHONE_VERSION || null,
594593
},
595594
QRCODE: {
596595
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,

0 commit comments

Comments
 (0)