[UE PS5 platform codes] when there is no ps5 friends in unreal codes, it does not fire delegate

if there is no ps5 friend is found, AllReadListCallbacksByLocalId.Remove(LocalUserId) is first called and eventually TriggerFriendDelegates does not fire delegate as it is empty. FOnReadFriendsListComplete cannot fire it from our codes so from our side, there is no way to know what happened if there is no ps5 friends.

Wondering if there is any other way to listen to it or it is bug and will be fixed later by removing AllReadListCallbacksByLocalId.Remove(LocalUserId) or other way.

Thank you

================ unreal 5 PS5 codes void FOnlineFriendsCrossgen::OnReadFriendsListComplete(const FOnlineError& OnlineError, const TArray& FriendAccountIds, const FUniqueNetIdSonyRef LocalUserId, const int32 LocalUserNum, FString ListName, const FOnReadFriendsListComplete Delegate) { if (OnlineError.WasSuccessful()) { if (FriendAccountIds.Num() > 0) { bCompleteFriendsRequestInitiated = true; RebuildFriendsList(LocalUserId, MoveTemp(ListName), FriendAccountIds); } else { // Handle if we do not have any friends associated with this account AllReadListCallbacksByLocalId.Remove(LocalUserId); UE_LOG_ONLINE_FRIEND(Verbose, TEXT(“OnReadFriendsListComplete returned successful but this account does not have any friends associated with it”)); TriggerFriendDelegates(LocalUserId, LocalUserNum, ListName, OnlineError); } } else { UE_LOG_ONLINE_FRIEND(Warning, TEXT(“OnReadFriendsListComplete returned unsuccessful reading of friends list: %s”), *OnlineError.ToLogString()); TriggerFriendDelegates(LocalUserId, LocalUserNum, ListName, OnlineError); } }

void FOnlineFriendsCrossgen::TriggerFriendDelegates(const FUniqueNetIdSonyRef UserId, const int32 LocalUserNum, const FString& ListName, const FOnlineError& OnlineError) { TMap<FString, TArray>& ReadListCompleteCallbacksByName = AllReadListCallbacksByLocalId.FindOrAdd(UserId); TArray CompletionCallbacks; ReadListCompleteCallbacksByName.RemoveAndCopyValue(ListName, CompletionCallbacks);
for (const FOnReadFriendsListComplete& Callback : CompletionCallbacks) { Callback.ExecuteIfBound(LocalUserNum, OnlineError.WasSuccessful(), ListName, OnlineError.GetErrorCode()); }
TriggerOnFriendsChangeDelegates(LocalUserNum); }

=========== our codes

FOnReadFriendsListComplete f = FOnReadFriendsListComplete();
f.BindLambda(
[=, this](int32 LocalUserNum, bool bWasSuccessful, const FString& ResultListName, const FString& ErrorStr)
{
if (bWasSuccessful)
{
T2GP_LOG(“LogRPC: Successfully read friends list with ErrorStr %s”, *ErrorStr);
OnSuccess.Broadcast(PlayerControllerWeakPtr.Get(), bWasSuccessful, ResultListName, ErrorStr);
}
else
{
T2GP_LOG(“LogRPC: Failed to read friends list with ErrorStr %s”, *ErrorStr);
OnFailure.Broadcast(PlayerControllerWeakPtr.Get(), bWasSuccessful, ResultListName, ErrorStr);
}
});

Friends->ReadFriendsList(ControllerId, ListName, f);