Data Validation's WaitForAssetCompilationIfNecessary Slow Task Not Working

We’ve noticed that if data validation hangs at the beginning due to waiting on additional loading/compiling in WaitForAssetCompilationIfNecessary(), the progress dialog not not update to reflect this. After digging into it, it appears that the FScopedSlowTask doesn’t seem to be properly set up. I tested things by adding a sleep loop that always waits for at least 7 seconds before returning. I found that at minimum the slow task needs to have Visibility set to ForceVisible and to call ForceRefresh(). The latter is necessary because MakeDialog will no-op due to ValidateAssetsInternal having already set up its own slow task and opening a dialog for it. Setting the Visibility seems to be necessary to ensure that the refresh immediately shows the updated message because it’s not guaranteed that anything else will trigger a refresh before the slow task is deactivated. Those two changes are enough to get the progress dialog to behave as expected.

The other weird thing though is that the slow task is currently in its own scope and will be removed from the slow task stack before the call to FAssetCompilingManager::Get().FinishAllCompilation(). I’m going to be changing that on our end to instead declare the FScopedSlowTask at the same scope as that call and instead pass bShowProgress through as the bInEnabled argument to slow task’s constructor.

Hey Peter,

thank you for the report!

I’ve had a look, and you’re correct, the usage here doesn’t make too much sense currently.

I’ll prepare a fix and hopefully get it submitted by next week.

Best,

Sebastian