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

fix: total number should be correct now in search (#5355)

The issue was that we all features were created exactly in same time,
and our feature counter waas expecting time to be unique to feature,
which was not the case.
This commit is contained in:
Jaanus Sellin 2023-11-21 10:08:20 +02:00 committed by GitHub
parent 11533bf97a
commit e79e30de96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -709,7 +709,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
const [, envName] = sortBy.split(':'); const [, envName] = sortBy.split(':');
rankingSql += this.db rankingSql += this.db
.raw( .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], [envName],
) )
.toString(); .toString();
@ -718,9 +718,9 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
.raw(`?? ${validatedSortOrder}`, [ .raw(`?? ${validatedSortOrder}`, [
sortByMapping[sortBy], sortByMapping[sortBy],
]) ])
.toString()}, features.created_at asc`; .toString()}, features.created_at asc, features.name asc`;
} else { } else {
rankingSql += `features.created_at ${validatedSortOrder}`; rankingSql += `features.created_at ${validatedSortOrder}, features.name asc`;
} }
query query