Skip to content
Snippets Groups Projects
Commit fa5af90e authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-18629 Fix observers failing to start fetching items in some cases

start(folder.first) ignored fetch request due to folder having version
parent 809ebe7d
No related branches found
No related tags found
No related merge requests found
...@@ -266,8 +266,8 @@ void LLInventoryFetchItemsObserver::startFetch() ...@@ -266,8 +266,8 @@ void LLInventoryFetchItemsObserver::startFetch()
LLSD items_llsd; LLSD items_llsd;
typedef std::map<LLUUID, uuid_vec_t> requests_by_fodlers_t; typedef std::map<LLUUID, uuid_vec_t> requests_by_folders_t;
requests_by_fodlers_t requests; requests_by_folders_t requests;
for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
{ {
LLViewerInventoryItem* item = gInventory.getItem(*it); LLViewerInventoryItem* item = gInventory.getItem(*it);
...@@ -335,12 +335,19 @@ void LLInventoryFetchItemsObserver::startFetch() ...@@ -335,12 +335,19 @@ void LLInventoryFetchItemsObserver::startFetch()
if (aisv3) if (aisv3)
{ {
const S32 MAX_INDIVIDUAL_REQUESTS = 10; const S32 MAX_INDIVIDUAL_REQUESTS = 10;
for (requests_by_fodlers_t::value_type &folder : requests) for (requests_by_folders_t::value_type &folder : requests)
{ {
LLViewerInventoryCategory* cat = gInventory.getCategory(folder.first);
if (folder.second.size() > MAX_INDIVIDUAL_REQUESTS) if (folder.second.size() > MAX_INDIVIDUAL_REQUESTS)
{ {
// requesting one by one will take a while // requesting one by one will take a while
// do whole folder // do whole folder
if (cat)
{
// Either drop version or use scheduleFolderFetch to force-fetch
// otherwise background fetch will ignore folders with set version
cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN);
}
LLInventoryModelBackgroundFetch::getInstance()->start(folder.first); LLInventoryModelBackgroundFetch::getInstance()->start(folder.first);
} }
else else
...@@ -355,7 +362,8 @@ void LLInventoryFetchItemsObserver::startFetch() ...@@ -355,7 +362,8 @@ void LLInventoryFetchItemsObserver::startFetch()
} }
else if (cat->getViewerDescendentCount() <= folder.second.size()) else if (cat->getViewerDescendentCount() <= folder.second.size())
{ {
// start fetching whole folder since we need all items // Start fetching whole folder since we need all items
// Drop version or use scheduleFolderFetch
cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN); cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN);
cat->fetch(); cat->fetch();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment