Replicated TArray of UObject, OnRep_ function called two times

If anyone else is blocking on this problem, here the solution :

Make a Onrep function proper to the array you want to replicate, with as parameter the same type than the variable. This input will be filled with the old value of the array.

If the old array size is equal to the new one, than it’s the object inside that has replicated.
If the old array size is greater than the new one, than it’s a remove.
If the old array size is lower than the new one, than it’s the array which replicate its size.

void UMyObject::OnRep_MyArray(TArray<UMySubObject*> OldMyArray)
{
	if (OldMyArray.Num() < MyArray.Num()) 
	{
		UE_LOG(LogTemp, Warning, TEXT("The array size increased !"));
	}
	else if(OldMyArray.Num() == MyArray.Num())
	{
		UE_LOG(LogTemp, Warning, TEXT("A UMySubObject replicated"));
	}
	else if(OldMyArray.Num() > MyArray.Num())
	{
		UE_LOG(LogTemp, Warning, TEXT("A UMySubObject was destroyed and removed"));
	}
}