diff --git a/CHANGELOG.md b/CHANGELOG.md index 429fd513..6b62084d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Include instance Id field in the instance configuration * Fixed the pairing code * Adjusts in typebot +* Fix the problem when disconnecting the instance and connecting again using mongodb # 1.6.0 (2023-12-12 17:24) diff --git a/src/whatsapp/services/monitor.service.ts b/src/whatsapp/services/monitor.service.ts index b449f693..0191079c 100644 --- a/src/whatsapp/services/monitor.service.ts +++ b/src/whatsapp/services/monitor.service.ts @@ -277,12 +277,6 @@ export class WAMonitoringService { public async cleaningUp(instanceName: string) { this.logger.verbose('cleaning up instance: ' + instanceName); - if (this.redis.ENABLED) { - this.logger.verbose('cleaning up instance in redis: ' + instanceName); - this.cache.reference = instanceName; - await this.cache.delAll(); - return; - } if (this.db.ENABLED && this.db.SAVE_DATA.INSTANCE) { this.logger.verbose('cleaning up instance in database: ' + instanceName); @@ -294,6 +288,13 @@ export class WAMonitoringService { return; } + if (this.redis.ENABLED) { + this.logger.verbose('cleaning up instance in redis: ' + instanceName); + this.cache.reference = instanceName; + await this.cache.delAll(); + return; + } + this.logger.verbose('cleaning up instance in files: ' + instanceName); rmSync(join(INSTANCE_DIR, instanceName), { recursive: true, force: true }); } @@ -441,8 +442,8 @@ export class WAMonitoringService { this.eventEmitter.on('logout.instance', async (instanceName: string) => { this.logger.verbose('logout instance: ' + instanceName); try { - // this.logger.verbose('request cleaning up instance: ' + instanceName); - // this.cleaningUp(instanceName); + this.logger.verbose('request cleaning up instance: ' + instanceName); + this.cleaningUp(instanceName); } finally { this.logger.warn(`Instance "${instanceName}" - LOGOUT`); } diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index d8f7c997..1f124504 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -1387,7 +1387,7 @@ export class WAStartupService { }, logger: P({ level: this.logBaileys }), printQRInTerminal: false, - browser: ['Chrome (Linux)', session.NAME, release()], + browser: number ? ['Chrome (Linux)', session.NAME, release()] : browser, version, markOnlineOnConnect: this.localSettings.always_online, retryRequestDelayMs: 10, @@ -1454,7 +1454,7 @@ export class WAStartupService { const { version } = await fetchLatestBaileysVersion(); const session = this.configService.get('CONFIG_SESSION_PHONE'); - // const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()]; + const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()]; let options; @@ -1474,7 +1474,7 @@ export class WAStartupService { }, logger: P({ level: this.logBaileys }), printQRInTerminal: false, - browser: ['Chrome (Linux)', session.NAME, release()], + browser: this.phoneNumber ? ['Chrome (Linux)', session.NAME, release()] : browser, version, markOnlineOnConnect: this.localSettings.always_online, retryRequestDelayMs: 10,