mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: now archived features are not marked as stale anymore (#6149)
This commit is contained in:
		
							parent
							
								
									71643f98c0
								
							
						
					
					
						commit
						b9a8280177
					
				| @ -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()], | ||||
|         ); | ||||
| 
 | ||||
|  | ||||
| @ -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[] = [ | ||||
|             { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user