summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-09-01 18:35:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-09-04 21:58:53 +0800
commit00bb3bb6f07660bd914d29a1389342bb3060d254 (patch)
tree431f574922494d2201718f13085f17bc6bd7fb42 /indra/newview/llaisapi.cpp
parenta8636720129952c10cf49ab80da21bf8b340b96c (diff)
parent4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff)
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp76
1 files changed, 50 insertions, 26 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index f67f2688a1..f0b7457fa2 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1039,6 +1039,19 @@ AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD&
mFetchDepth = request_body["depth"].asInteger();
}
+ // Some tasks are time sensitive, don't wait for them.
+ // Like FETCHCOF which happens on load and is needed for outfit
+ // loading.
+ // FETCHCATEGORYLINKS is used for wearing outfits and fetching
+ // a user selected outfit or for following an outfit link in COF.
+ // Other tasks, like FETCHCATEGORYSUBSET are general background
+ // fetches and can safely wait.
+ // Do count 'time sensitive' tasks in batch timer.
+ mUseTimeout =
+ type != AISAPI::UPDATECATEGORY
+ && type != AISAPI::UPDATEITEM
+ && type != AISAPI::FETCHCOF
+ && type != AISAPI::FETCHCATEGORYLINKS;
mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS);
mTaskTimer.start();
@@ -1069,6 +1082,11 @@ void AISUpdate::clearParseResults()
void AISUpdate::checkTimeout()
{
+ if (!mUseTimeout)
+ {
+ // Priority task, don't wait.
+ return;
+ }
if (mTaskTimer.hasExpired() || sBatchTimer.hasExpired())
{
// If we are taking too long, don't starve other tasks,
@@ -1758,35 +1776,41 @@ void AISUpdate::doUpdate()
const LLUUID id = ucv_it->first;
S32 version = static_cast<S32>(ucv_it->second);
LLViewerInventoryCategory *cat = gInventory.getCategory(id);
- LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
- if (cat->getVersion() != version)
+ // Update can be rather large and take time to process.
+ // By the time update gets to the category, it could
+ // could have been removed by the user
+ if (cat)
{
- // the AIS version should be considered the true version. Adjust
- // our local category model to reflect this version number. Otherwise
- // it becomes possible to get stuck with the viewer being out of
- // sync with the inventory system. Under normal circumstances
- // inventory COF is maintained on the viewer through calls to
- // LLInventoryModel::accountForUpdate when a changing operation
- // is performed. This occasionally gets out of sync however.
- if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
- {
- LL_WARNS() << "Possible version mismatch for category " << cat->getName()
- << ", viewer version " << cat->getVersion()
- << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL;
- cat->setVersion(version);
- }
- else
+ LL_DEBUGS("Inventory") << "cat " << cat->getName() << " version update from " << cat->getVersion() << " to AIS version " << version << LL_ENDL;
+ if (cat->getVersion() != version)
{
- // We do not account for update if version is UNKNOWN, so we shouldn't rise version
- // either or viewer will get stuck on descendants count -1, try to refetch folder instead
- //
- // Todo: proper backoff?
+ // the AIS version should be considered the true version. Adjust
+ // our local category model to reflect this version number. Otherwise
+ // it becomes possible to get stuck with the viewer being out of
+ // sync with the inventory system. Under normal circumstances
+ // inventory COF is maintained on the viewer through calls to
+ // LLInventoryModel::accountForUpdate when a changing operation
+ // is performed. This occasionally gets out of sync however.
+ if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
+ {
+ LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+ << ", viewer version " << cat->getVersion()
+ << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL;
+ cat->setVersion(version);
+ }
+ else
+ {
+ // We do not account for update if version is UNKNOWN, so we shouldn't riase version
+ // either or viewer will get stuck on descendants count -1, try to refetch folder instead
+ //
+ // Todo: proper backoff?
- LL_WARNS() << "Possible version mismatch for category " << cat->getName()
- << ", viewer version " << cat->getVersion()
- << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL;
- const S32 LONG_EXPIRY = 360;
- cat->fetch(LONG_EXPIRY);
+ LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+ << ", viewer version " << cat->getVersion()
+ << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL;
+ const S32 LONG_EXPIRY = 360;
+ cat->fetch(LONG_EXPIRY);
+ }
}
}
}