Temporary asset copies of ActorComponent used for diffing are selectable in component asset pickers

If the user diffs two revisions of an ActorComponent blueprint, and then they proceed to add it to an Actor blueprint, then three copies will appear in the search list when browsing for the component to add: one real, and two temporary ones. If a temporary one is selected, and the asset is saved and submitted, then problems can arise with failed builds and broken references.

Reason: When diffing assets in revision control, a copy of each is downloaded to a temporary directory, and they’re not supposed to be used for other purposes. However, these copies are still in memory, and they can be erroneously added to systems that don’t check that these assets are for diffing. When diffing blueprints in revision control whose parent is ActorComponent, the temporary copies are added to the ComponentTypeRegistry.

It appears that the ComponentTypeRegistry queries both the global objects array and the AssetRegistry for component classes, regardless of whatever package flags are present. (See function ForceRefreshComponentList() in ComponentTypeRegistry.cpp.)

One potential solution is to modify ComponentTypeRegistry.cpp to filter out packages with the PKG_ForDiffing flag from its results when it does its global in-memory scan.

[Attachment Removed]

Steps to Reproduce

  1. Select a blueprint class in revision control whose parent is ActorComponent.
  2. Right-click and select Revision Control -> History.
  3. Diff two of its revisions.
  4. Open an Actor blueprint and click Add Component.
  5. Search for the component that you tried diffing.

Observe that the component appears three times in the search list. One is real, the other two are the temporary ones created for diffing.

[Attachment Removed]

I have created a PR with a fix that should address this bug.

[Attachment Removed]

Thank you Andrew this is the same approach as I would’ve taken. I’ll get your PR submitted today

[Attachment Removed]

submitted to 50280788

[Attachment Removed]