From d42f2a1887a1bc94a97c08bfe676731672ce53d3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 30 May 2023 00:01:58 +0300 Subject: SL-17429 Message user when their inventory hits AIS3 limits --- indra/newview/llaisapi.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index b09b8ec517..fcee3a3e91 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -32,11 +32,12 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" +#include "llnotificationsutil.h" #include "llsdutil.h" #include "llviewerregion.h" #include "llvoavatar.h" #include "llvoavatarself.h" -#include "llinventoryobserver.h" #include "llviewercontrol.h" ///---------------------------------------------------------------------------- @@ -893,11 +894,21 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht } } } - else if (status.getType() == 403) + else if (status == LLCore::HttpStatus(HTTP_FORBIDDEN) /*403*/) { if (type == FETCHCATEGORYCHILDREN) { - LL_DEBUGS("Inventory") << "Fetch failed, content is over imit" << LL_ENDL; + if (body.has("depth") && body["depth"].asInteger() == 0) + { + // Can't fetch a single folder with depth 0, folder is too big. + LLNotificationsUtil::add("InventoryLimitReachedAIS"); + LL_WARNS("Inventory") << "Fetch failed, content is over limit, url: " << url << LL_ENDL; + } + else + { + // Result was too big, but situation is recoverable by requesting with lower depth + LL_DEBUGS("Inventory") << "Fetch failed, content is over limit, url: " << url << LL_ENDL; + } } } LL_WARNS("Inventory") << "Inventory error: " << status.toString() << LL_ENDL; -- cgit v1.2.3