mirror of
				https://github.com/matrix-org/synapse.git
				synced 2025-10-31 16:21:56 +01:00 
			
		
		
		
	Fix caching error in the push evaluator
Initialising `result` to `{}` in the parameters meant that every call to
_flatten_dict used the *same* target dictionary.
I'm hopeful this will fix https://github.com/matrix-org/synapse/issues/2270,
but I suspect it won't. (This code seems to have been here since forever,
unlike the bug, and I don't really think it explains the observed
behaviour). Still, it makes it hard to investigate the problem.
			
			
This commit is contained in:
		
							parent
							
								
									cca94272fa
								
							
						
					
					
						commit
						73cfe48031
					
				| @ -200,7 +200,9 @@ def _glob_to_re(glob, word_boundary): | ||||
|         return re.compile(r, flags=re.IGNORECASE) | ||||
| 
 | ||||
| 
 | ||||
| def _flatten_dict(d, prefix=[], result={}): | ||||
| def _flatten_dict(d, prefix=[], result=None): | ||||
|     if result is None: | ||||
|         result = {} | ||||
|     for key, value in d.items(): | ||||
|         if isinstance(value, basestring): | ||||
|             result[".".join(prefix + [key])] = value.lower() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user