From 8b2b36196d3b2b062307122a345c015840643558 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Thu, 1 Sep 2022 11:58:31 +0000 Subject: [PATCH 1/3] chore(release): 2.0.173 [skip ci] ## [2.0.173](https://github.com/GeneralBots/BotServer/compare/2.0.172...2.0.173) (2022-09-01) ### Bug Fixes * **whatsapp.gblib:** .gbapp message subprocessing. ([e72b030](https://github.com/GeneralBots/BotServer/commit/e72b030e9554c6d442de643f73e9a3f19460973f)) * **whatsapp.gblib:** .gbapp message subprocessing. ([9c00ddd](https://github.com/GeneralBots/BotServer/commit/9c00dddd78eeebe6ef8b156f3cc9a044c7756b1c)) --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a66498bb..0c062452 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [2.0.173](https://github.com/GeneralBots/BotServer/compare/2.0.172...2.0.173) (2022-09-01) + + +### Bug Fixes + +* **whatsapp.gblib:** .gbapp message subprocessing. ([e72b030](https://github.com/GeneralBots/BotServer/commit/e72b030e9554c6d442de643f73e9a3f19460973f)) +* **whatsapp.gblib:** .gbapp message subprocessing. ([9c00ddd](https://github.com/GeneralBots/BotServer/commit/9c00dddd78eeebe6ef8b156f3cc9a044c7756b1c)) + ## [2.0.172](https://github.com/GeneralBots/BotServer/compare/2.0.171...2.0.172) (2022-09-01) diff --git a/package.json b/package.json index 3889b1f7..f6d75219 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "2.0.172", + "version": "2.0.173", "description": "General Bot Community Edition open-core server.", "main": "./boot.js", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", From c14a766047ec1cad9e52104a52a10afb93b8fd71 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Fri, 2 Sep 2022 10:32:07 -0300 Subject: [PATCH 2/3] fix(whatsapp.gblib): .gbapp message subprocessing. --- .../services/WhatsappDirectLine.ts | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 2023621e..36af8a0e 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -227,11 +227,12 @@ export class WhatsappDirectLine extends GBService { const express = require('express'); GBServer.globals.server.use(`/audios`, express.static('work')); - - try { - const res = await request.post(options); - } catch (error) { - GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`); + if (options) { + try { + await request.post(options); + } catch (error) { + GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`); + } } } } @@ -698,12 +699,14 @@ export class WhatsappDirectLine extends GBService { break; } - try { - // tslint:disable-next-line: await-promise - const result = await request.post(options); - GBLog.info(`File ${url} sent to ${to}: ${result}`); - } catch (error) { - GBLog.error(`Error sending file to Whatsapp provider ${error.message}`); + if (options) { + try { + // tslint:disable-next-line: await-promise + const result = await request.post(options); + GBLog.info(`File ${url} sent to ${to}: ${result}`); + } catch (error) { + GBLog.error(`Error sending file to Whatsapp provider ${error.message}`); + } } } @@ -742,13 +745,13 @@ export class WhatsappDirectLine extends GBService { break; } - try { - - // tslint:disable-next-line: await-promise - const result = await request.post(options); - GBLog.info(`Audio ${url} sent to ${to}: ${result}`); - } catch (error) { - GBLog.error(`Error sending audio message to Whatsapp provider ${error.message}`); + if (options) { + try { + const result = await request.post(options); + GBLog.info(`Audio ${url} sent to ${to}: ${result}`); + } catch (error) { + GBLog.error(`Error sending audio message to Whatsapp provider ${error.message}`); + } } } @@ -817,16 +820,16 @@ export class WhatsappDirectLine extends GBService { break; } - try { - GBLog.info(`Message [${msg}] is being sent to ${to}...`); - // tslint:disable-next-line: await-promise - if (this.provider !== "GeneralBots") { + if (options) { + try { + GBLog.info(`Message [${msg}] is being sent to ${to}...`); await request.post(options); } - } catch (error) { - GBLog.error(`Error sending message to Whatsapp provider ${error.message}`); + catch (error) { + GBLog.error(`Error sending message to Whatsapp provider ${error.message}`); - // TODO: Handle Error: socket hang up and retry. + // TODO: Handle Error: socket hang up and retry. + } } } } From faccecf76e158039978f0ab99f154dec8435eb79 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Fri, 2 Sep 2022 13:40:28 +0000 Subject: [PATCH 3/3] chore(release): 2.0.174 [skip ci] ## [2.0.174](https://github.com/GeneralBots/BotServer/compare/2.0.173...2.0.174) (2022-09-02) ### Bug Fixes * **whatsapp.gblib:** .gbapp message subprocessing. ([c14a766](https://github.com/GeneralBots/BotServer/commit/c14a766047ec1cad9e52104a52a10afb93b8fd71)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c062452..439f925b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.0.174](https://github.com/GeneralBots/BotServer/compare/2.0.173...2.0.174) (2022-09-02) + + +### Bug Fixes + +* **whatsapp.gblib:** .gbapp message subprocessing. ([c14a766](https://github.com/GeneralBots/BotServer/commit/c14a766047ec1cad9e52104a52a10afb93b8fd71)) + ## [2.0.173](https://github.com/GeneralBots/BotServer/compare/2.0.172...2.0.173) (2022-09-01) diff --git a/package.json b/package.json index f6d75219..bca8c570 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "2.0.173", + "version": "2.0.174", "description": "General Bot Community Edition open-core server.", "main": "./boot.js", "bugs": "https://github.com/pragmatismo-io/BotServer/issues",