OutdatedKnownStaticMeshDetected caused by the order of RepNotifies between UStaticMeshComponent vs Actor and other components

Hi,

I do believe the issue here lies in the interaction between the replication system and the StaticMeshComponent, as like you pointed out, the engine will update the StaticMesh pointer property before later calling OnRep_StaticMesh, allowing other OnRep functions to attempt to access the static mesh before it has been properly set. The static mesh component expects that the handling in SetStaticMesh will be done when the StaticMesh is changed, rather than this property just getting set directly, and the replication code seems to break this expectation.

I have observed what you’ve described here, where OutdatedKnownStaticMeshDetected will still call NotifyIfStaticMeshChanged as a last resort, leading to the material being set without issue. Even in a packaged repro project, I didn’t see any errors or other issues. Having discussed this some more with a dev more familiar with the static mesh component, you can silence the ensure, but it does come with the risk that materials/textures/etc. may not apply correctly in this gap where the reverse lookup is out of date. If you do run into issues with this ensure disabled, please don’t hesitate to reach out.

I’ve also updated UE-156362 to reflect this new repro, as I believe the previous situation that caused that issue to be opened has been addressed.

Thanks,

Alex