Skip to content

Commit

Permalink
fix: only get rows for toggles in project (#5141)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg authored Oct 24, 2023
1 parent 1909880 commit 898c1b4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/lib/features/feature-toggle/feature-toggle-strategies-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,17 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
.leftJoin('feature_tag as ft', 'ft.feature_name', 'features.name');

if (this.flagResolver.isEnabled('useLastSeenRefactor')) {
query.leftJoin(
'last_seen_at_metrics',
'last_seen_at_metrics.environment',
'environments.name',
);
query.leftJoin('last_seen_at_metrics', function () {
this.on(
'last_seen_at_metrics.environment',
'=',
'environments.name',
).andOn(
'last_seen_at_metrics.feature_name',
'=',
'features.name',
);
});
}

let selectColumns = [
Expand Down Expand Up @@ -615,7 +621,6 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {

query = query.select(selectColumns);
const rows = await query;

if (rows.length > 0) {
const overview = this.getFeatureOverviewData(getUniqueRows(rows));
return sortEnvironments(overview);
Expand Down

0 comments on commit 898c1b4

Please sign in to comment.