mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: env variants event changelog (#4712)
https://linear.app/unleash/issue/2-1397/fix-environment-variants-change-event-does-not-include-changelogs By running `applyPatch` without cloning the `oldVariants`, `applyPatch` would patch the `oldVariants` by reference, effectively making them the same as the `newVariants`. This fix `deepClone`s the oldVariants when sending them in as an `applyPatch` parameter so that the `oldVariants` variable is left untouched. 
This commit is contained in:
		
							parent
							
								
									93ccb06f6d
								
							
						
					
					
						commit
						f68b0ad001
					
				| @ -1898,7 +1898,10 @@ class FeatureToggleService { | ||||
|             featureName, | ||||
|             environment, | ||||
|         ); | ||||
|         const { newDocument } = await applyPatch(oldVariants, newVariants); | ||||
|         const { newDocument } = await applyPatch( | ||||
|             deepClone(oldVariants), | ||||
|             newVariants, | ||||
|         ); | ||||
|         return this.crProtectedSaveVariantsOnEnv( | ||||
|             project, | ||||
|             featureName, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user