[PR] Instanced structs inside non-complex property nodes

Dear support team,

I stumbled upon a rare issue, where an ensure() triggers with message “Expected to find a complex parent” (FStructurePropertyNode::GetOwnerPackages(), line 100). This was because I had a rather complex nesting of properties including instanced structs in an array.

It seems there’s a subtle bug when walking up properties. I created a fix for this. Could you have a look at it, please? Thanks in advance.

https://github.com/EpicGames/UnrealEngine/pull/13588

Steps to Reproduce

  • Create a nested data layout with instanced structs inside non-complex properties, such as : struct => array<instanced struct> => some properties => array<instanced struct> => some properties
  • Instantiate some actor with this in the world
  • Edit details.
    • Works better with a single boolean value deeply nested. Spam-click the checkbox until an ensure() araises (~ 1 / 20 repro).

Hi Benoit, thank you for the additional context. I have added it to our internal tracking on the PR, and the dev team will investigate the PR as it aligns to their roadmaps.

Thanks. Despite I don’t catch everything which happens during UI refresh, I’ll add some details and hypotheses if I may:

  • The fact the reproduction is not 100% makes me think something non-deterministic happens during the refresh. Maybe some async operation?
  • Maybe the fact the structure owning my nested instanced struct does have a customization (IPropertyTypeCustomization + FInstancedStructDataDetails) influences this. I can’t figure out why, but that’s a possibility.
  • After I hit the ensure() once (breakpoint on line 100), it sometimes turned to 100% repro after.
  • When the issue arises, it seems the topmost property node (which should be a struct node) turns to be a simple property node. This obviously explains the ensure(), but still I can’t explain why, since there’s no reason it should “magically” be something else than a struct node.
    • Maybe this “simple property node” issue should never arise. In this case, maybe we should find the origin of it first.
  • As far as I understand the impacted region of code, the line I added is no harm (= doesn’t have side effects).

Sorry I don’t have solid evidence of why this happens, but I hope these details will help.