From cebbdf2d129c0c039385125454d9198f42e7e596 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 11 Oct 2023 22:34:00 +0300 Subject: SL-20436 New accounts that select outfit in web fail to download clothing --- indra/newview/llinventoryobserver.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index b6c2e954a4..fe067b621a 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -418,10 +418,22 @@ void LLInventoryFetchDescendentsObserver::changed(U32 mask) } ++it; } - if (mIncomplete.empty()) - { - done(); - } + + if (mIncomplete.empty()) + { + done(); + } + else + { + LLInventoryModelBackgroundFetch* fetcher = LLInventoryModelBackgroundFetch::getInstance(); + if (fetcher->isEverythingFetched() + && !fetcher->folderFetchActive()) + { + // If fetcher is done with folders yet we are waiting, fetch either + // failed or version is somehow stuck at -1 + done(); + } + } } void LLInventoryFetchDescendentsObserver::startFetch() @@ -432,12 +444,8 @@ void LLInventoryFetchDescendentsObserver::startFetch() if (!cat) continue; if (!isCategoryComplete(cat)) { - // CHECK IT: isCategoryComplete() checks both version and descendant count but - // fetch() only works for Unknown version and doesn't care about descentants, - // as result fetch won't start and folder will potentially get stuck as - // incomplete in observer. - // Likely either both should use only version or both should check descendants. - cat->fetch(); //blindly fetch it without seeing if anything else is fetching it. + //blindly fetch it without seeing if anything else is fetching it. + LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(*it, true); mIncomplete.push_back(*it); //Add to list of things being downloaded for this observer. } else -- cgit v1.2.3