How to Refresh the Skeleton Editor in C++ ?

I’m trying to develop a plugin in Unreal Engine that allows the creation of a custom asset called “SocketAsset.” This asset can programmatically generate sockets for skeletons.

Currently, the plugin works mostly as expected. However, when the Skeleton Editor is open and new sockets are added, the editor does not refresh properly to show the changes.

I called MarkPackageDirty(), and it does correctly mark the asset with an asterisk (*) in the editor. However, calling PostEditChange() does not trigger the editor to refresh.

Which class’s member function should I call to refresh the Skeleton Editor?

Here’s part explanatory screenshots and some rookie-level code:

////this is a CallInEditor function
void USocketAsset::ApplySockets()
{
	bool bModified = false;
	for(FSocketInfo SKInfo : SocketInfos)
	{
		if(ApplySingleSocket(SKInfo))
			bModified = true;
	}
	if(bModified)
	{
		TargetSkeleton->PostEditChange();
		TargetSkeleton->MarkPackageDirty();
	}
}
//This is the function that actually adds sockets to the skeleton. It's rather lengthy and not recommended for reading.
bool USocketAsset::ApplySingleSocket(const FSocketInfo SocketInfo)
{
	if(!TargetSkeleton)
		return false;
	if(!SocketInfo.IsValid())
		return false;
	const FReferenceSkeleton& ReferenceSkeleton = TargetSkeleton->GetReferenceSkeleton();
	const TArray<FMeshBoneInfo>& MeshBoneInfo = ReferenceSkeleton.GetRefBoneInfo();
	bool bModified = false;
	for(FMeshBoneInfo SingleBoneInfo : MeshBoneInfo)
	{
		if(SingleBoneInfo.Name == SocketInfo.SocketName)
		break;
		if(SingleBoneInfo.Name == SocketInfo.ParentName)
		{
			USkeletalMeshSocket* SKSocket = TargetSkeleton->FindSocket(SocketInfo.SocketName);
			if(SKSocket)
			{
				if(!bModified)
				TargetSkeleton->Modify();
				
				SKSocket->RelativeLocation = SocketInfo.SocketTransform.GetLocation();
				SKSocket->RelativeRotation = SocketInfo.SocketTransform.Rotator();
				SKSocket->RelativeScale =  bOverrideScaleTo1 ? FVector(1) : SocketInfo.SocketTransform.GetScale3D();
				bModified = true;
			}
			else
			{
				USkeletalMeshSocket* NewSocket = NewObject<USkeletalMeshSocket>(TargetSkeleton);
				if (NewSocket)
				{
					if(!bModified)
					TargetSkeleton->Modify();
					
					NewSocket->BoneName = SocketInfo.ParentName;
					NewSocket->SocketName = SocketInfo.SocketName;
					NewSocket->RelativeLocation = SocketInfo.SocketTransform.GetLocation();
					NewSocket->RelativeRotation = SocketInfo.SocketTransform.Rotator();
					NewSocket->RelativeScale =  bOverrideScaleTo1 ? FVector(1) : SocketInfo.SocketTransform.GetScale3D();

					TargetSkeleton->Sockets.Add(NewSocket);
					bModified = true;
				}
			}
		}
	}
	if(bModified)
		return true;
	
	return false;
}