diff --git a/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts b/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts index 92a39ea0f5..c3a5674233 100644 --- a/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts +++ b/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts @@ -709,7 +709,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore { const [, envName] = sortBy.split(':'); rankingSql += this.db .raw( - `CASE WHEN feature_environments.environment = ? THEN feature_environments.enabled ELSE NULL END ${validatedSortOrder} NULLS LAST, features.created_at asc`, + `CASE WHEN feature_environments.environment = ? THEN feature_environments.enabled ELSE NULL END ${validatedSortOrder} NULLS LAST, features.created_at asc, features.name asc`, [envName], ) .toString(); @@ -718,9 +718,9 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore { .raw(`?? ${validatedSortOrder}`, [ sortByMapping[sortBy], ]) - .toString()}, features.created_at asc`; + .toString()}, features.created_at asc, features.name asc`; } else { - rankingSql += `features.created_at ${validatedSortOrder}`; + rankingSql += `features.created_at ${validatedSortOrder}, features.name asc`; } query