summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-12-18 20:45:04 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-12-18 20:45:04 +0000
commitd9ba2a8100f1fa6b6844f58b884595c123770a8a (patch)
tree12bd3cabe13c8baebab2e15d5c5b91dc6a1b10f6
parent9156c22f73b6706a3f480d0fd72ed04a7de8187b (diff)
SL-14570 - error messages, avoid a couple of warnings caused by attempts to create folders before inventory is loaded
-rw-r--r--indra/newview/llfavoritesbar.cpp10
-rw-r--r--indra/newview/llinventorymodel.cpp32
2 files changed, 29 insertions, 13 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 347997a69a..d258bea519 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1859,9 +1859,17 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
pref_changed |= mRecreateFavoriteStorage;
mRecreateFavoriteStorage = false;
+ // Can get called before inventory is done initializing.
+ if (!gInventory.isInventoryUsable())
+ {
+ return FALSE;
+ }
+
LLUUID favorite_folder= gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
if (favorite_folder.isNull())
- return FALSE;
+ {
+ return FALSE;
+ }
LLInventoryModel::item_array_t items;
LLInventoryModel::cat_array_t cats;
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 741c3317f5..ff007c2f39 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -3765,12 +3765,12 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
if (getRootFolderID().isNull())
{
- LL_WARNS("Inventory") << "no root folder id" << LL_ENDL;
+ LL_WARNS("Inventory") << "Fatal inventory corruption: no root folder id" << LL_ENDL;
fatalities++;
}
if (getLibraryRootFolderID().isNull())
{
- LL_WARNS("Inventory") << "no library root folder id" << LL_ENDL;
+ LL_WARNS("Inventory") << "Fatal inventory corruption: no library root folder id" << LL_ENDL;
fatalities++;
}
@@ -3801,6 +3801,9 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
warnings++;
continue;
}
+ LLUUID topmost_ancestor_id;
+ // Will leave as null uuid on failure
+ getObjectTopmostAncestor(cat_id, topmost_ancestor_id);
if (cat_id != cat->getUUID())
{
LL_WARNS("Inventory") << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL;
@@ -3832,12 +3835,17 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
}
else if (cats->size() + items->size() != cat->getDescendentCount())
{
- LL_WARNS("Inventory") << "invalid desc count for " << cat_id << " name [" << cat->getName()
- << "] parent " << cat->getParentUUID()
- << " cached " << cat->getDescendentCount()
- << " expected " << cats->size() << "+" << items->size()
- << "=" << cats->size() +items->size() << LL_ENDL;
- warnings++;
+ // In the case of library this is not unexpected, since
+ // different user accounts may be getting the library
+ // contents from different inventory hosts.
+ if (topmost_ancestor_id.isNull() || topmost_ancestor_id != getLibraryRootFolderID())
+ {
+ LL_WARNS("Inventory") << "invalid desc count for " << cat_id << " [" << getFullPath(cat) << "]"
+ << " cached " << cat->getDescendentCount()
+ << " expected " << cats->size() << "+" << items->size()
+ << "=" << cats->size() +items->size() << LL_ENDL;
+ warnings++;
+ }
}
if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
@@ -4103,7 +4111,7 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
// Need to create, if allowed.
if (is_automatic)
{
- LL_WARNS("Inventory") << "Cannot create system folder of type " << ft << LL_ENDL;
+ LL_WARNS("Inventory") << "Fatal inventory corruption: cannot create system folder of type " << ft << LL_ENDL;
fatalities++;
}
else
@@ -4114,7 +4122,7 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
}
else if (count_under_root > 1)
{
- LL_WARNS("Inventory") << "System folder type has excess copies under root, type " << ft << " count " << count_under_root << LL_ENDL;
+ LL_WARNS("Inventory") << "Fatal inventory corruption: system folder type has excess copies under root, type " << ft << " count " << count_under_root << LL_ENDL;
fatalities++;
}
if (count_elsewhere > 0)
@@ -4141,8 +4149,8 @@ LLPointer<LLInventoryValidationInfo> LLInventoryModel::validate() const
}
// FIXME need to fail login and tell user to retry, contact support if problem persists.
- bool valid = (fatalities + warnings == 0);
- LL_INFOS("Inventory") << "Validate done, valid = " << (U32) valid << LL_ENDL;
+ bool valid = (fatalities == 0);
+ LL_INFOS("Inventory") << "Validate done, fatal errors: " << fatalities << ", warnings: " << warnings << ", valid: " << valid << LL_ENDL;
validation_info->mFatalErrorCount = fatalities;
validation_info->mWarningCount = warnings;