From 24f8f47d46b9f04d2c14571fd83e1f683296ff2f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 21 Mar 2023 23:59:03 +0200 Subject: SL-19188 Fix thumbnail changes being ignored by outfit gallery --- indra/newview/llinventoryobserver.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 26d7a7a28a..b884721895 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -649,6 +649,13 @@ void LLInventoryCategoriesObserver::changed(U32 mask) } } + const LLUUID thumbnail_id = category->getThumbnailUUID(); + if (cat_data.mThumbnailId != thumbnail_id) + { + cat_data.mThumbnailId = thumbnail_id; + cat_changed = true; + } + // If anything has changed above, fire the callback. if (cat_changed) cat_data.mCallback(); @@ -666,6 +673,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN; S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN; bool can_be_added = true; + LLUUID thumbnail_id; LLViewerInventoryCategory* category = gInventory.getCategory(cat_id); // If category could not be retrieved it might mean that @@ -677,6 +685,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t // Inventory category version is used to find out if some changes // to a category have been made. version = category->getVersion(); + thumbnail_id = category->getThumbnailUUID(); LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; @@ -702,11 +711,11 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t if(init_name_hash) { LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cat_id); - mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents,item_name_hash))); + mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents,item_name_hash))); } else { - mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents))); + mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents))); } } @@ -719,24 +728,26 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id) } LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( - const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents) + const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents) : mCatID(cat_id) , mCallback(cb) , mVersion(version) , mDescendentsCount(num_descendents) + , mThumbnailId(thumbnail_id) , mIsNameHashInitialized(false) { mItemNameHash.finalize(); } LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( - const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash) + const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash) : mCatID(cat_id) , mCallback(cb) , mVersion(version) , mDescendentsCount(num_descendents) + , mThumbnailId(thumbnail_id) , mIsNameHashInitialized(true) , mItemNameHash(name_hash) { -- cgit v1.2.3 From 1800e969c5fa443f18ea4b01e59840e4bbf2afeb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Mar 2023 00:34:48 +0200 Subject: SL-18003 Use AISv3 cap in LLInventoryFetchItemsObserver --- indra/newview/llinventoryobserver.cpp | 37 +++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index b884721895..809fbe4100 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -37,6 +37,7 @@ #include "llagent.h" #include "llagentwearables.h" +#include "llaisapi.h" #include "llfloater.h" #include "llfocusmgr.h" #include "llinventorybridge.h" @@ -251,6 +252,8 @@ void fetch_items_from_llsd(const LLSD& items_llsd) void LLInventoryFetchItemsObserver::startFetch() { + bool aisv3 = AISAPI::isAvailable(); + LLUUID owner_id; LLSD items_llsd; for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) @@ -294,17 +297,39 @@ void LLInventoryFetchItemsObserver::startFetch() // pack this on the message. mIncomplete.push_back(*it); - // Prepare the data to fetch - LLSD item_entry; - item_entry["owner_id"] = owner_id; - item_entry["item_id"] = (*it); - items_llsd.append(item_entry); + if (aisv3) + { + // doesn't support bulk fetching, request one by one + if (owner_id == ALEXANDRIA_LINDEN_ID) + { + AISAPI::FetchItem(*it, AISAPI::LIBRARY); + } + else + { + AISAPI::FetchItem(*it, AISAPI::INVENTORY); + } + // Todo: remove item from mIncomplete on callback + // but keep in mind that observer can expire before + // callback + } + else + { + // Prepare the data to fetch + LLSD item_entry; + item_entry["owner_id"] = owner_id; + item_entry["item_id"] = (*it); + items_llsd.append(item_entry); + } } mFetchingPeriod.reset(); mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); - fetch_items_from_llsd(items_llsd); + if (!aisv3) + { + fetch_items_from_llsd(items_llsd); + } + } LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver(const LLUUID& cat_id) : -- cgit v1.2.3 From 9fa64f1e2087a8e45adad7298d2dd3661bd80e25 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Mar 2023 18:03:09 +0200 Subject: SL-18003 Fix items not being marked as complete when fetched via ais --- indra/newview/llinventoryobserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 809fbe4100..25f1854765 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -310,7 +310,7 @@ void LLInventoryFetchItemsObserver::startFetch() } // Todo: remove item from mIncomplete on callback // but keep in mind that observer can expire before - // callback + // callback or use LLInventoryModelBackgroundFetch } else { -- cgit v1.2.3 From 6fd7427c576ec922b6c670b4ff9381c7cb738b5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 26 Mar 2023 13:44:50 +0300 Subject: SL-18003 Bulk fetch some items by fetching whole folder --- indra/newview/llinventoryobserver.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 25f1854765..79917fb11b 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -40,6 +40,7 @@ #include "llaisapi.h" #include "llfloater.h" #include "llfocusmgr.h" +#include "llinventorymodelbackgroundfetch.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" -- cgit v1.2.3 From b00e2da9e23f4dad9c754ce479253ac07eeec154 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 27 Mar 2023 21:04:51 +0300 Subject: SL-18003 Faster cof fetching --- indra/newview/llinventoryobserver.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 79917fb11b..fe33be4abe 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -300,18 +300,7 @@ void LLInventoryFetchItemsObserver::startFetch() if (aisv3) { - // doesn't support bulk fetching, request one by one - if (owner_id == ALEXANDRIA_LINDEN_ID) - { - AISAPI::FetchItem(*it, AISAPI::LIBRARY); - } - else - { - AISAPI::FetchItem(*it, AISAPI::INVENTORY); - } - // Todo: remove item from mIncomplete on callback - // but keep in mind that observer can expire before - // callback or use LLInventoryModelBackgroundFetch + LLInventoryModelBackgroundFetch::getInstance()->start(*it); } else { -- cgit v1.2.3 From 89a8c96f36983738645a2116d9d432e3bd88f1df Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 28 Mar 2023 02:27:34 +0300 Subject: SL-18003 Bulk download items when possible And signal fodler fetch completion when folder of recursive fetch is done, do not hold it for individual items --- indra/newview/llinventoryobserver.cpp | 106 ++++++++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 23 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index fe33be4abe..4db913ed0d 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -255,29 +255,19 @@ void LLInventoryFetchItemsObserver::startFetch() { bool aisv3 = AISAPI::isAvailable(); - LLUUID owner_id; LLSD items_llsd; + + typedef std::map requests_by_fodlers_t; + requests_by_fodlers_t requests; for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if (item) - { - if (item->isFinished()) - { - // It's complete, so put it on the complete container. - mComplete.push_back(*it); - continue; - } - else - { - owner_id = item->getPermissions().getOwner(); - } - } - else - { - // assume it's agent inventory. - owner_id = gAgent.getID(); - } + LLViewerInventoryItem* item = gInventory.getItem(*it); + if (item && item->isFinished()) + { + // It's complete, so put it on the complete container. + mComplete.push_back(*it); + continue; + } // Ignore categories since they're not items. We // could also just add this to mComplete but not sure what the @@ -300,13 +290,31 @@ void LLInventoryFetchItemsObserver::startFetch() if (aisv3) { - LLInventoryModelBackgroundFetch::getInstance()->start(*it); + if (item) + { + LLUUID parent_id = item->getParentUUID(); + requests[parent_id].push_back(*it); + } + else + { + // Can happen for gestures and calling cards if server notified us before they fetched + // Request by id without checking for an item. + LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(*it); + } } else { // Prepare the data to fetch LLSD item_entry; - item_entry["owner_id"] = owner_id; + if (item) + { + item_entry["owner_id"] = item->getPermissions().getOwner(); + } + else + { + // assume it's agent inventory. + item_entry["owner_id"] = gAgent.getID(); + } item_entry["item_id"] = (*it); items_llsd.append(item_entry); } @@ -315,7 +323,59 @@ void LLInventoryFetchItemsObserver::startFetch() mFetchingPeriod.reset(); mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); - if (!aisv3) + if (aisv3) + { + const S32 MAX_INDIVIDUAL_REQUESTS = 10; + for (requests_by_fodlers_t::value_type &folder : requests) + { + if (folder.second.size() > MAX_INDIVIDUAL_REQUESTS) + { + // requesting one by one will take a while + // do whole folder + LLInventoryModelBackgroundFetch::getInstance()->start(folder.first); + } + else + { + LLViewerInventoryCategory* cat = gInventory.getCategory(folder.first); + if (cat) + { + if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // start fetching whole folder since it's not ready either way + cat->fetch(); + } + else if (cat->getViewerDescendentCount() <= folder.second.size()) + { + // start fetching whole folder since we need all items + cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN); + cat->fetch(); + + } + else + { + // get items one by one + for (LLUUID &item_id : folder.second) + { + LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(item_id); + } + } + } + else + { + // Isn't supposed to happen? We should have all folders + // and if item exists, folder is supposed to exist as well. + llassert(false); + + // get items one by one + for (LLUUID &item_id : folder.second) + { + LLInventoryModelBackgroundFetch::getInstance()->scheduleItemFetch(item_id); + } + } + } + } + } + else { fetch_items_from_llsd(items_llsd); } -- cgit v1.2.3 From 3c23be758ef8804047bf96d0619bd95e7760e904 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 Apr 2023 21:22:30 +0300 Subject: SL-19534 Fixed fetch timeout during initial fetch --- indra/newview/llinventoryobserver.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 4db913ed0d..0b02528246 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -151,7 +151,7 @@ LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& i void LLInventoryFetchItemsObserver::changed(U32 mask) { - LL_DEBUGS() << this << " remaining incomplete " << mIncomplete.size() + LL_DEBUGS("InventoryFetch") << this << " remaining incomplete " << mIncomplete.size() << " complete " << mComplete.size() << " wait period " << mFetchingPeriod.getRemainingTimeF32() << LL_ENDL; @@ -160,6 +160,15 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) // appropriate. if (!mIncomplete.empty()) { + if (!LLInventoryModelBackgroundFetch::getInstance()->isEverythingFetched()) + { + // Folders have a priority over items and they download items as well + // Wait untill initial folder fetch is done + LL_DEBUGS("InventoryFetch") << "Folder fetch in progress, resetting fetch timer" << LL_ENDL; + + mFetchingPeriod.reset(); + mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); + } // Have we exceeded max wait time? bool timeout_expired = mFetchingPeriod.hasExpired(); @@ -178,7 +187,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) if (timeout_expired) { // Just concede that this item hasn't arrived in reasonable time and continue on. - LL_WARNS() << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL; + LL_WARNS("InventoryFetch") << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL; it = mIncomplete.erase(it); } else @@ -193,7 +202,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) if (mIncomplete.empty()) { - LL_DEBUGS() << this << " done at remaining incomplete " + LL_DEBUGS("InventoryFetch") << this << " done at remaining incomplete " << mIncomplete.size() << " complete " << mComplete.size() << LL_ENDL; done(); } -- cgit v1.2.3 From fa5af90e30aaaf638d5083dff6258a66da06c00c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 15 Aug 2023 00:00:40 +0300 Subject: SL-18629 Fix observers failing to start fetching items in some cases start(folder.first) ignored fetch request due to folder having version --- indra/newview/llinventoryobserver.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 0b02528246..0d96c7a005 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -266,8 +266,8 @@ void LLInventoryFetchItemsObserver::startFetch() LLSD items_llsd; - typedef std::map requests_by_fodlers_t; - requests_by_fodlers_t requests; + typedef std::map requests_by_folders_t; + requests_by_folders_t requests; for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) { LLViewerInventoryItem* item = gInventory.getItem(*it); @@ -335,12 +335,19 @@ void LLInventoryFetchItemsObserver::startFetch() if (aisv3) { 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) { // requesting one by one will take a while // 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); } else @@ -355,7 +362,8 @@ void LLInventoryFetchItemsObserver::startFetch() } 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->fetch(); -- cgit v1.2.3 From fa47e4402b7925a45c5fec9fb9d92fb5e34a589e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 14 Sep 2023 18:42:42 +0300 Subject: SL-20285 Sturdier cof and fixed link fetching --- indra/newview/llinventoryobserver.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 227d4285eb..51be44bef4 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -334,21 +334,14 @@ void LLInventoryFetchItemsObserver::startFetch() if (aisv3) { - const S32 MAX_INDIVIDUAL_REQUESTS = 10; + const S32 MAX_INDIVIDUAL_REQUESTS = 7; for (requests_by_folders_t::value_type &folder : requests) { - LLViewerInventoryCategory* cat = gInventory.getCategory(folder.first); if (folder.second.size() > MAX_INDIVIDUAL_REQUESTS) { // requesting one by one will take a while // 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()->scheduleFolderFetch(folder.first, true); } else { @@ -360,12 +353,11 @@ void LLInventoryFetchItemsObserver::startFetch() // start fetching whole folder since it's not ready either way cat->fetch(); } - else if (cat->getViewerDescendentCount() <= folder.second.size()) + else if (cat->getViewerDescendentCount() <= folder.second.size() + || cat->getDescendentCount() <= folder.second.size()) { // Start fetching whole folder since we need all items - // Drop version or use scheduleFolderFetch - cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN); - cat->fetch(); + LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true); } else @@ -382,6 +374,7 @@ void LLInventoryFetchItemsObserver::startFetch() // Isn't supposed to happen? We should have all folders // and if item exists, folder is supposed to exist as well. llassert(false); + LL_WARNS("Inventory") << "Missing folder: " << folder.first << " fetching items individually" << LL_ENDL; // get items one by one for (LLUUID &item_id : folder.second) -- cgit v1.2.3 From b09c19d27ceb2a3695cd688b1ccffcb3084f0e46 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 14 Sep 2023 20:58:42 +0300 Subject: SL-20285 Updated individual request count declaration --- indra/newview/llinventoryobserver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventoryobserver.cpp') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 51be44bef4..281a8bc789 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -58,6 +58,7 @@ #include "llsdutil.h" #include +const S32 LLInventoryFetchItemsObserver::MAX_INDIVIDUAL_ITEM_REQUESTS = 7; const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 60.0f; @@ -334,10 +335,9 @@ void LLInventoryFetchItemsObserver::startFetch() if (aisv3) { - const S32 MAX_INDIVIDUAL_REQUESTS = 7; for (requests_by_folders_t::value_type &folder : requests) { - if (folder.second.size() > MAX_INDIVIDUAL_REQUESTS) + if (folder.second.size() > MAX_INDIVIDUAL_ITEM_REQUESTS) { // requesting one by one will take a while // do whole folder -- cgit v1.2.3