diff --git a/src/lib/features/dependent-features/dependent-features-store.ts b/src/lib/features/dependent-features/dependent-features-store.ts index f01f11d5d13d..e7768a1dcff7 100644 --- a/src/lib/features/dependent-features/dependent-features-store.ts +++ b/src/lib/features/dependent-features/dependent-features-store.ts @@ -23,6 +23,11 @@ export class DependentFeaturesStore implements IDependentFeaturesStore { featureDependency.variants, ); } + // TODO: remove when we support multiple parents + await this.db('dependent_features') + .where('child', featureDependency.child) + .del(); + await this.db('dependent_features') .insert(serializableFeatureDependency) .onConflict(['parent', 'child']) diff --git a/src/test/e2e/api/client/feature.e2e.test.ts b/src/test/e2e/api/client/feature.e2e.test.ts index 58912e866478..57c9194fa205 100644 --- a/src/test/e2e/api/client/feature.e2e.test.ts +++ b/src/test/e2e/api/client/feature.e2e.test.ts @@ -60,11 +60,6 @@ beforeAll(async () => { 'featureY', { feature: 'featureX', variants: ['featureXVariant'] }, ); - // depend on parent being disabled - await app.services.dependentFeaturesService.upsertFeatureDependency( - 'featureY', - { feature: 'featureZ', enabled: false }, - ); await app.services.featureToggleServiceV2.archiveToggle( 'featureArchivedX', @@ -154,10 +149,6 @@ test('returns dependencies', async () => { enabled: true, variants: ['featureXVariant'], }, - { - feature: 'featureZ', - enabled: false, - }, ], }); expect(res.body.features[1].dependencies).toBe(undefined);