From 285e0a41b0ad676a7015a237dd828eb686da1c14 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 23 Jul 2026 14:17:48 -0700 Subject: Was not correctly parsing metadata from task inventory API, fix how I was using the cache control. --- indra/llinventory/llinventory.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llscripteditorws.cpp | 28 +++++++++++++++++++++++----- indra/newview/llscripteditorws.h | 8 ++++---- 3 files changed, 57 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 1fcf70dc25..a7edc3a383 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -63,6 +63,7 @@ static const std::string INV_CREATION_DATE_LABEL("created_at"); static const std::string INV_TOGGLED_LABEL("toggled"); static const std::string INV_SCRIPT_LABEL("script"); static const std::string INV_RUNTIME_LABEL("runtime"); +static const std::string INV_METADATA_LABEL("metadata"); // key used by agent-inventory-service static const std::string INV_ASSET_TYPE_LABEL_WS("type_default"); @@ -1114,6 +1115,35 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new) continue; } + if (i->first == INV_METADATA_LABEL) + { + // Server (non-AIS) exports thumbnail/favorite/script nested under + // a "metadata" wrapper; mirror the legacy-stream parser behavior. + const LLSD& metadata = i->second; + if (metadata.has(INV_THUMBNAIL_LABEL)) + { + const LLSD& thumbnail = metadata[INV_THUMBNAIL_LABEL]; + if (thumbnail.has(INV_ASSET_ID_LABEL)) + { + mThumbnailUUID = thumbnail[INV_ASSET_ID_LABEL].asUUID(); + } + } + if (metadata.has(INV_FAVORITE_LABEL)) + { + const LLSD& favorite = metadata[INV_FAVORITE_LABEL]; + if (favorite.has(INV_TOGGLED_LABEL)) + { + mFavorite = favorite[INV_TOGGLED_LABEL].asBoolean(); + } + } + if (metadata.has(INV_SCRIPT_LABEL) + && metadata[INV_SCRIPT_LABEL].has(INV_RUNTIME_LABEL)) + { + mRuntime = metadata[INV_SCRIPT_LABEL][INV_RUNTIME_LABEL].asString(); + } + continue; + } + if (i->first == INV_PERMISSIONS_LABEL) { mPermissions.importLLSD(i->second); diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index e0bf9b0b61..555affe9a1 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -156,11 +156,11 @@ namespace } return std::string(s); } -} -LLCachedControl LLScriptEditorWSServer::sEnableScriptEditorWS(gSavedSettings, "ExternalWebsocketSyncEnable", false); -LLCachedControl LLScriptEditorWSServer::sTightIntegration(gSavedSettings, "ExternalEditorTightIntegration", false); + LLCachedControl* OPT_ENABLESCRIPTEDITORWS(nullptr); + LLCachedControl* OPT_TIGHTINTEGRATION(nullptr); +} class LLPublishedPrimListener : public LLVOInventoryListener { @@ -203,8 +203,8 @@ private: }; //======================================================================== -LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only) - : LLJSONRPCServer(name, port, local_only) +LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only): + LLJSONRPCServer(name, port, local_only) { LL_INFOS("ScriptEditorWS") << "Created JSON-RPC script editor server: " << name << " on port " << port << LL_ENDL; @@ -221,6 +221,24 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); } +bool LLScriptEditorWSServer::isEnabled() +{ + if (!OPT_ENABLESCRIPTEDITORWS) + { + OPT_ENABLESCRIPTEDITORWS = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncEnable", false); + } + return *OPT_ENABLESCRIPTEDITORWS; +} + +bool LLScriptEditorWSServer::isTightIntegration() +{ + if (!OPT_TIGHTINTEGRATION) + { + OPT_TIGHTINTEGRATION = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); + } + return *OPT_TIGHTINTEGRATION; +} + LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning() { if (!LLScriptEditorWSServer::isEnabled()) diff --git a/indra/newview/llscripteditorws.h b/indra/newview/llscripteditorws.h index 33b19f8a97..de64b6946d 100644 --- a/indra/newview/llscripteditorws.h +++ b/indra/newview/llscripteditorws.h @@ -211,8 +211,8 @@ public: void onLinksetChildAdded(const LLUUID& root_id, LLViewerObject* child); void onLinksetChildRemoved(const LLUUID& root_id, const LLUUID& child_id); - static bool isEnabled() { return sEnableScriptEditorWS; } - static bool isTightIntegration() { return sTightIntegration; } + static bool isEnabled(); + static bool isTightIntegration(); protected: LLWebsocketMgr::WSConnection::ptr_t connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, @@ -354,6 +354,6 @@ private: static constexpr F32 CLEANUP_INTERVAL = 60.0f; // seconds static constexpr F32 CONNECTION_TIMEOUT = 300.0f; // 5 minutes - static LLCachedControl sEnableScriptEditorWS; - static LLCachedControl sTightIntegration; + LLCachedControl *mEnableScriptEditorWS; + LLCachedControl *mTightIntegration; }; -- cgit v1.3 From 5101e69367293d6d47bdb7383eabe7993e055050 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 23 Jul 2026 19:33:32 -0700 Subject: Make the cached controls static to the function. --- indra/newview/llscripteditorws.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index 555affe9a1..17ebd03ed2 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -157,9 +157,6 @@ namespace return std::string(s); } - LLCachedControl* OPT_ENABLESCRIPTEDITORWS(nullptr); - LLCachedControl* OPT_TIGHTINTEGRATION(nullptr); - } class LLPublishedPrimListener : public LLVOInventoryListener @@ -223,20 +220,14 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() bool LLScriptEditorWSServer::isEnabled() { - if (!OPT_ENABLESCRIPTEDITORWS) - { - OPT_ENABLESCRIPTEDITORWS = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncEnable", false); - } - return *OPT_ENABLESCRIPTEDITORWS; + static LLCachedControl OPT_ENABLESCRIPTEDITORWS(gSavedSettings, "ExternalWebsocketSyncEnable", false); + return OPT_ENABLESCRIPTEDITORWS; } bool LLScriptEditorWSServer::isTightIntegration() { - if (!OPT_TIGHTINTEGRATION) - { - OPT_TIGHTINTEGRATION = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); - } - return *OPT_TIGHTINTEGRATION; + static LLCachedControl OPT_TIGHTINTEGRATION(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); + return OPT_TIGHTINTEGRATION; } LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning() -- cgit v1.3 From ae6997dc22c2597c8a84be53011587c8a031b77b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 24 Jul 2026 09:01:18 -0700 Subject: Forgot to remove something from the header. --- indra/newview/llscripteditorws.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscripteditorws.h b/indra/newview/llscripteditorws.h index de64b6946d..69c7e1a8e1 100644 --- a/indra/newview/llscripteditorws.h +++ b/indra/newview/llscripteditorws.h @@ -354,6 +354,4 @@ private: static constexpr F32 CLEANUP_INTERVAL = 60.0f; // seconds static constexpr F32 CONNECTION_TIMEOUT = 300.0f; // 5 minutes - LLCachedControl *mEnableScriptEditorWS; - LLCachedControl *mTightIntegration; }; -- cgit v1.3