Merge pull request #2332 from joinads/main
Security Scan / Dependency Review (push) Has been skipped
Security Scan / CodeQL Analysis (javascript) (push) Failing after 2m30s
Check Code Quality / check-lint-and-build (push) Successful in 3m34s
Build Docker image / Build and Deploy (push) Failing after 4m6s

Evolution API - Multi-Device Fix
This commit is contained in:
Davidson Gomes
2026-02-09 16:07:12 -03:00
committed by GitHub
@@ -67,7 +67,6 @@ import {
Chatwoot, Chatwoot,
ConfigService, ConfigService,
configService, configService,
ConfigSessionPhone,
Database, Database,
Log, Log,
Openai, Openai,
@@ -124,7 +123,6 @@ import makeWASocket, {
Product, Product,
proto, proto,
UserFacingSocketConfig, UserFacingSocketConfig,
WABrowserDescription,
WAMediaUpload, WAMediaUpload,
WAMessage, WAMessage,
WAMessageKey, WAMessageKey,
@@ -143,7 +141,6 @@ import Long from 'long';
import mimeTypes from 'mime-types'; import mimeTypes from 'mime-types';
import NodeCache from 'node-cache'; import NodeCache from 'node-cache';
import cron from 'node-cron'; import cron from 'node-cron';
import { release } from 'os';
import { join } from 'path'; import { join } from 'path';
import P from 'pino'; import P from 'pino';
import qrcode, { QRCodeToDataURLOptions } from 'qrcode'; import qrcode, { QRCodeToDataURLOptions } from 'qrcode';
@@ -624,19 +621,9 @@ export class BaileysStartupService extends ChannelStartupService {
private async createClient(number?: string): Promise<WASocket> { private async createClient(number?: string): Promise<WASocket> {
this.instance.authState = await this.defineAuthState(); this.instance.authState = await this.defineAuthState();
const session = this.configService.get<ConfigSessionPhone>('CONFIG_SESSION_PHONE'); if (number) {
let browserOptions = {};
if (number || this.phoneNumber) {
this.phoneNumber = number; this.phoneNumber = number;
this.logger.info(`Phone number: ${number}`); this.logger.info(`Phone number: ${number}`);
} else {
const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()];
browserOptions = { browser };
this.logger.info(`Browser: ${browser}`);
} }
// Fetch latest WhatsApp Web version automatically // Fetch latest WhatsApp Web version automatically
@@ -697,7 +684,7 @@ export class BaileysStartupService extends ChannelStartupService {
msgRetryCounterCache: this.msgRetryCounterCache, msgRetryCounterCache: this.msgRetryCounterCache,
generateHighQualityLinkPreview: true, generateHighQualityLinkPreview: true,
getMessage: async (key) => (await this.getMessage(key)) as Promise<proto.IMessage>, getMessage: async (key) => (await this.getMessage(key)) as Promise<proto.IMessage>,
...browserOptions, // Removido browserOptions para usar Multi-Device nativo (não WebClient)
markOnlineOnConnect: this.localSettings.alwaysOnline, markOnlineOnConnect: this.localSettings.alwaysOnline,
retryRequestDelayMs: 350, retryRequestDelayMs: 350,
maxMsgRetryCount: 4, maxMsgRetryCount: 4,