From ff4c0ad1de0cf6ef689cb4a9b9596500a878e1c3 Mon Sep 17 00:00:00 2001 From: iFergal Date: Tue, 27 Aug 2024 15:21:44 +0100 Subject: [PATCH] fix: await sends --- src/keri/app/exchanging.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/keri/app/exchanging.ts b/src/keri/app/exchanging.ts index de39378b..4605c188 100644 --- a/src/keri/app/exchanging.ts +++ b/src/keri/app/exchanging.ts @@ -79,7 +79,8 @@ export class Exchanges { embeds: Dict, recipients: string[] ): Promise { - return recipients.map(async (recipient) => { + const responses: any[] = []; + for (const recipient of recipients) { const [exn, sigs, atc] = await this.createExchangeMessage( sender, route, @@ -87,10 +88,11 @@ export class Exchanges { embeds, recipient ); - return this.sendFromEvents(name, topic, exn, sigs, atc, [ + responses.push(await this.sendFromEvents(name, topic, exn, sigs, atc, [ recipient, - ]); - }); + ])); + }; + return responses; } /**