From 83912d872bdffed67a29e0612f68e1600bdbb74a Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 28 May 2024 11:32:20 +0300 Subject: [PATCH] fix: fix empty events when no features need to be deleted (#7181) --- src/lib/features/feature-toggle/feature-toggle-service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/features/feature-toggle/feature-toggle-service.ts b/src/lib/features/feature-toggle/feature-toggle-service.ts index ad7fb75daa..3db086704b 100644 --- a/src/lib/features/feature-toggle/feature-toggle-service.ts +++ b/src/lib/features/feature-toggle/feature-toggle-service.ts @@ -1951,6 +1951,11 @@ class FeatureToggleService { const eligibleFeatureNames = eligibleFeatures.map( (toggle) => toggle.name, ); + + if (eligibleFeatures.length === 0) { + return; + } + const tags = await this.tagStore.getAllByFeatures(eligibleFeatureNames); await this.featureToggleStore.batchDelete(eligibleFeatureNames);