From e431c101492615276dd9b7b7399c28d94f28c28d Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 11 Dec 2024 11:56:15 +0100 Subject: [PATCH] Add mising await --- src/commands/local-store/local-store-command.js | 5 +++-- .../protocols/common/protocol-request-command.js | 14 +++----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/commands/local-store/local-store-command.js b/src/commands/local-store/local-store-command.js index 57e249026..b701b087a 100644 --- a/src/commands/local-store/local-store-command.js +++ b/src/commands/local-store/local-store-command.js @@ -55,7 +55,7 @@ class LocalStoreCommand extends Command { ); if (storeType === LOCAL_STORE_TYPES.TRIPLE) { - const storePromises = []; + // const storePromises = []; // if (cachedData.dataset && cachedData.datasetRoot) { // storePromises.push( @@ -71,7 +71,7 @@ class LocalStoreCommand extends Command { // this.pendingStorageService.cacheDataset(operationId, datasetRoot, dataset), // ); // } - await Promise.all(storePromises); + // await Promise.all(storePromises); const identityId = await this.blockchainModuleManager.getIdentityId(blockchain); const signature = await this.blsService.sign(datasetRoot); @@ -81,6 +81,7 @@ class LocalStoreCommand extends Command { operationId, blockchain, ); + await this.operationService.processResponse( command, OPERATION_REQUEST_STATUS.COMPLETED, diff --git a/src/commands/protocols/common/protocol-request-command.js b/src/commands/protocols/common/protocol-request-command.js index dd7066dae..161ddaf29 100644 --- a/src/commands/protocols/common/protocol-request-command.js +++ b/src/commands/protocols/common/protocol-request-command.js @@ -15,20 +15,12 @@ class ProtocolRequestCommand extends ProtocolMessageCommand { async execute(command) { const { operationId, blockchain } = command.data; - await this.operationIdService.emitChangeEvent( - this.operationStartEvent, - operationId, - blockchain, - ); - const result = this.executeProtocolMessageCommand( + this.operationIdService.emitChangeEvent(this.operationStartEvent, operationId, blockchain); + const result = await this.executeProtocolMessageCommand( command, NETWORK_MESSAGE_TYPES.REQUESTS.PROTOCOL_REQUEST, ); - await this.operationIdService.emitChangeEvent( - this.operationEndEvent, - operationId, - blockchain, - ); + this.operationIdService.emitChangeEvent(this.operationEndEvent, operationId, blockchain); return result; }