Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Mar 5, 2024
1 parent f44828b commit e8284c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/lib/features/feature-toggle/feature-toggle-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,11 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
.count('type')
.groupBy('type');

query.where({
project: projectId,
archived,
});
query
.where({
project: projectId,
})
.modify(FeatureToggleStore.filterByArchived, archived);

const result = await query;
return result.map((row) => ({
Expand Down Expand Up @@ -677,7 +678,8 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
WHERE feature_types.id = features.type) *
INTERVAL '1 day'))) as current_staleness
FROM features
WHERE NOT stale = true AND archived_at IS NULL`,
WHERE NOT stale = true
AND archived_at IS NULL`,
[currentTime || this.db.fn.now()],
);

Expand Down
4 changes: 0 additions & 4 deletions src/test/e2e/services/project-service.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2070,19 +2070,15 @@ test('should get correct amount of features archived in current and past window'
await Promise.all([
updateFeature(toggles[0].name, {
archived_at: new Date(),
archived: true,
}),
updateFeature(toggles[1].name, {
archived_at: new Date(),
archived: true,
}),
updateFeature(toggles[2].name, {
archived_at: subDays(new Date(), 31),
archived: true,
}),
updateFeature(toggles[3].name, {
archived_at: subDays(new Date(), 31),
archived: true,
}),
]);

Expand Down

0 comments on commit e8284c6

Please sign in to comment.