diff --git a/packages/basic.gblib/services/DialogKeywords.ts b/packages/basic.gblib/services/DialogKeywords.ts index c063f9ea..c7b66846 100644 --- a/packages/basic.gblib/services/DialogKeywords.ts +++ b/packages/basic.gblib/services/DialogKeywords.ts @@ -1462,7 +1462,7 @@ export class DialogKeywords { const pngs = await GBUtil.pdfPageAsImage(min, pdf, undefined); await CollectionUtil.asyncForEach(pngs, async png => { - await GBUtil.sleep(500); + await GBUtil.sleep(2000); // Prepare a cache to be referenced by Bot Framework. url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', path.basename(png.localName)); diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts index 2baf555d..4128b78d 100644 --- a/packages/core.gbapp/services/GBMinService.ts +++ b/packages/core.gbapp/services/GBMinService.ts @@ -1114,7 +1114,11 @@ export class GBMinService { step.context.activity['pid'] = pid; const notes = min.core.getParam(min.instance, 'Notes', null); - await this.handleUploads(min, step, user, params, notes != null); + if (await this.handleUploads(min, step, user, params, notes != null)) + { + return; + + } // Required for MSTEAMS handling of persisted conversations. @@ -1358,7 +1362,7 @@ export class GBMinService { private async handleUploads(min, step, user, params, autoSave) { // Prepare Promises to download each attachment and then execute each Promise. - + let ret = false; if ( step.context.activity.attachments && step.context.activity.attachments[0] && @@ -1370,6 +1374,7 @@ export class GBMinService { const successfulSaves = await Promise.all(promises); async function replyForReceivedAttachments(attachmentData) { if (attachmentData) { + // In case of not having HEAR activated before, it is // a upload with no Dialog, so run Auto Save to .gbdrive. @@ -1406,6 +1411,7 @@ export class GBMinService { const replyPromises = successfulSaves.map(replyForReceivedAttachments.bind(step.context)); await Promise.all(replyPromises); if (successfulSaves.length > 0) { + ret = true; class GBFile { data: Buffer; filename: string; @@ -1429,11 +1435,13 @@ export class GBMinService { throw new Error('It is only possible to upload one file per message, right now.'); } min.cbMap[user.userId].promise = results[0]; + return; } else { return; } } } + return ret; } /** diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index e6f50504..b11fe823 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -802,8 +802,8 @@ export class WhatsappDirectLine extends GBService { image: { link: imageUrl, caption: caption, - view_once: true }, + view_once: true }; const response = await fetch(sendMessageEndpoint, {