1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: archived flags without metrics do not count towards onboarding (#8443)

This commit is contained in:
Jaanus Sellin 2024-10-14 14:09:57 +03:00 committed by GitHub
parent 735e6f0b23
commit 39fb1b5db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,15 +92,6 @@ export class OnboardingReadModel implements IOnboardingReadModel {
return null;
}
const feature = await this.db('features')
.select('name')
.where('project', projectId)
.first();
if (!feature) {
return { status: 'onboarding-started' };
}
const db = this.db;
const lastSeen = await db
.select(db.raw('1'))
@ -117,8 +108,17 @@ export class OnboardingReadModel implements IOnboardingReadModel {
if (lastSeen) {
return { status: 'onboarded' };
} else {
return { status: 'first-flag-created', feature: feature.name };
}
const feature = await this.db('features')
.select('name')
.where('project', projectId)
.where('archived_at', null)
.first();
if (!feature) {
return { status: 'onboarding-started' };
}
return { status: 'first-flag-created', feature: feature.name };
}
}