Assert triggered in Iris with FFastArraySerializer type combined with ReplicatedUsing

Hi,

I’m seeing an issue where a replicating a type based on FFastArraySerializer in a UPROPERTY with ReplicatedUsing=OnRep_Func asserts with Iris, in FFastArrayReplicationFragmentBase since the resultant replication fragment has both HasRepNotifies and KeepPreviousState flags. The OnRep function takes an ‘old value’ parameter.

(offending snippet below)

This is testing Iris with our game in UE 5.5.

  1. Is this combination of FastArraySerializer and ReplicatedUsing with old value param supported in Iris?
  2. If so, is this a known issue with 5.5, and fixed in later version of the engine

Thanks,

Alistair

if (EnumHasAnyFlags(InTraits, EReplicationFragmentTraits::CanReceive))
{
    if (EnumHasAnyFlags(InDescriptor->Traits, EReplicationStateTraits::HasRepNotifies))
    {
       if (EnumHasAnyFlags(InDescriptor->Traits, EReplicationStateTraits::KeepPreviousState))
       {
          check(false);
       }
 
       Traits |= EReplicationFragmentTraits::HasRepNotifies;
    }
 
    // For now we always expect pre/post operations for legacy states, we might make this optional
    Traits |= EReplicationFragmentTraits::NeedsLegacyCallbacks;
}

Steps to Reproduce

Hi,

I don’t believe fast arrays support passing in an old value param to their repnotify function, and it is generally recommended to use the PreReplicatedRemove, PostReplicatedAdd, and PostReplicatedChange callbacks for fast arrays. If you need the old value of the array/item during one of these functions, you will likely need to manually cache this on the owning object.

Thanks,

Alex