@ -203,7 +203,7 @@ export async function handleNewClosedGroup(
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					      // Enable typing:
 
 
					 
					 
					 
					      // Enable typing:
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					      maybeConvo . set ( 'isKickedFromGroup' ,  false ) ; 
 
					 
					 
					 
					      maybeConvo . set ( 'isKickedFromGroup' ,  false ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					      maybeConvo . set ( 'left' ,  false ) ; 
 
					 
					 
					 
					      maybeConvo . set ( 'left' ,  false ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					      maybeConvo . set ( 'lastJoinedTimestamp' ,  Date . now ( ) ) ; 
 
					 
					 
					 
					      maybeConvo . set ( 'lastJoinedTimestamp' ,  _ . toNumber ( envelope . timestamp ) ) ; 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					    }  else  { 
 
					 
					 
					 
					    }  else  { 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					      log . warn ( 
 
					 
					 
					 
					      log . warn ( 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        'Ignoring a closed group message of type NEW: the conversation already exists' 
 
					 
					 
					 
					        'Ignoring a closed group message of type NEW: the conversation already exists' 
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -242,6 +242,12 @@ export async function handleNewClosedGroup(
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					  // the sending pipeline needs to know from GroupUtils when a message is for a medium group
 
 
					 
					 
					 
					  // the sending pipeline needs to know from GroupUtils when a message is for a medium group
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					  await  ClosedGroup . updateOrCreateClosedGroup ( groupDetails ) ; 
 
					 
					 
					 
					  await  ClosedGroup . updateOrCreateClosedGroup ( groupDetails ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					  // ClosedGroup.updateOrCreateClosedGroup will mark the activeAt to Date.now if it's active
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					  // But we need to override this value with the sent timestamp of the message creating this group for us.
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					  // Having that timestamp set will allow us to pickup incoming group update which were sent between
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					  // envelope.timestamp and Date.now(). And we need to listen to those (some might even remove us)
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					  convo . set ( 'lastJoinedTimestamp' ,  _ . toNumber ( envelope . timestamp ) ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					  await  convo . commit ( ) ; 
 
					 
					 
					 
					  await  convo . commit ( ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					  // sanity checks validate this
 
 
					 
					 
					 
					  // sanity checks validate this
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					  // tslint:disable: no-non-null-assertion
 
 
					 
					 
					 
					  // tslint:disable: no-non-null-assertion