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

fix: now archived features are not marked as stale anymore (#6149)

This commit is contained in:
Jaanus Sellin 2024-02-07 12:53:25 +02:00 committed by GitHub
parent 71643f98c0
commit b9a8280177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View File

@ -677,7 +677,7 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
WHERE feature_types.id = features.type) *
INTERVAL '1 day'))) as current_staleness
FROM features
WHERE NOT stale = true`,
WHERE NOT stale = true AND archived_at IS NULL`,
[currentTime || this.db.fn.now()],
);

View File

@ -167,6 +167,27 @@ describe('potentially_stale marking', () => {
expect(markedToggles).toStrictEqual([]);
});
test('it does not mark archived toggles potentially stale', async () => {
const features: FeatureToggleInsert[] = [
{
name: 'feature1',
type: 'release',
archived: true,
createdByUserId: 9999,
},
];
await Promise.all(
features.map((feature) =>
featureToggleStore.create('default', feature),
),
);
const markedToggles =
await featureToggleStore.updatePotentiallyStaleFeatures(
getFutureTimestamp(1000),
);
expect(markedToggles).toStrictEqual([]);
});
test('it does not return toggles previously marked as potentially_stale', async () => {
const features: FeatureToggleInsert[] = [
{