From 7124377f1c85c45c50a78b48305952f9908485e9 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 17 Jun 2024 14:20:11 +0100 Subject: [PATCH] fix: avoid uncaught exception when polling validator indices --- packages/validator/src/services/indices.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/validator/src/services/indices.ts b/packages/validator/src/services/indices.ts index dcc129cc591e..c6ef40b473e5 100644 --- a/packages/validator/src/services/indices.ts +++ b/packages/validator/src/services/indices.ts @@ -83,10 +83,8 @@ export class IndicesService { return this.pollValidatorIndicesPromise; } - this.pollValidatorIndicesPromise = this.pollValidatorIndicesInternal(pubkeysHex); - // Once the pollValidatorIndicesInternal() resolves or rejects null the cached promise so it can be called again. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.pollValidatorIndicesPromise.finally(() => { + this.pollValidatorIndicesPromise = this.pollValidatorIndicesInternal(pubkeysHex).finally(() => { + // Once the pollValidatorIndicesInternal() resolves or rejects null the cached promise so it can be called again. this.pollValidatorIndicesPromise = null; }); return this.pollValidatorIndicesPromise;