summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarl <me@darl.cat>2026-04-03 22:57:53 -0500
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-04-07 20:48:52 +0300
commit0a42b9f220c320b9cdc43987ff1f0d9871a4958b (patch)
tree01d98aa1e64b58713ef9715d7c669cd1fcf73682
parent901ad6193b767b07028b816a1b3284927491c3db (diff)
Attempt one additional mute list request from simulator after region change
Signed-off-by: Darl <me@darl.cat>
-rw-r--r--indra/newview/llmutelist.cpp46
-rw-r--r--indra/newview/llmutelist.h16
2 files changed, 58 insertions, 4 deletions
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index f8bdc453b2..b72301c566 100644
--- a/indra/newview/llmutelist.cpp
+++ b/indra/newview/llmutelist.cpp
@@ -190,6 +190,8 @@ LLMuteList::LLMuteList() :
// but this way is just more convinient
onAccountNameChanged(id, av_name.getUserName());
});
+ // Register our region change callback handler early, we'll clean it up if/when we don't need it anymore.
+ mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLMuteList::onRegionChanged, this));
}
//-----------------------------------------------------------------------------
@@ -203,6 +205,10 @@ LLMuteList::~LLMuteList()
void LLMuteList::cleanupSingleton()
{
LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(nullptr);
+ if (mRegionChangedCallback.connected())
+ {
+ mRegionChangedCallback.disconnect();
+ }
}
bool LLMuteList::isLinden(const std::string& name)
@@ -826,6 +832,11 @@ bool LLMuteList::isMuted(const std::string& username, U32 flags) const
//-----------------------------------------------------------------------------
void LLMuteList::requestFromServer(const LLUUID& agent_id)
{
+ if(isLoadedFromServer())
+ {
+ LL_WARNS() << "Blocked attempt to request mute list from server when already loaded from server!" << LL_ENDL;
+ return;
+ }
const std::string filename = getCacheFilename(agent_id);
LLCRC crc;
crc.update(filename);
@@ -886,6 +897,11 @@ void LLMuteList::cache(const LLUUID& agent_id)
void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
{
LL_INFOS() << "LLMuteList::processMuteListUpdate()" << LL_ENDL;
+ LLMuteList* mute_list = getInstance();
+ if(mute_list->mTriedRegionChangeRetry)
+ {
+ LL_WARNS() << "Received mute list update after retrying region change; success!" << LL_ENDL;
+ }
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_MuteData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
@@ -901,7 +917,6 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
LL_WARNS() << "Received empty mute list filename." << LL_ENDL;
}
- LLMuteList* mute_list = getInstance();
mute_list->mLoadState = ML_REQUESTED;
mute_list->mRequestStartTime = LLTimer::getTotalSeconds();
@@ -922,7 +937,12 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
{
LL_INFOS() << "LLMuteList::processUseCachedMuteList()" << LL_ENDL;
- LLMuteList::getInstance()->loadFromFile(LLMuteList::getInstance()->getCacheFilename(gAgent.getID()), MLS_SERVER_CACHE);
+ LLMuteList* mute_list = LLMuteList::getInstance();
+ if(mute_list->mTriedRegionChangeRetry)
+ {
+ LL_WARNS() << "Received use cached mute list message after retrying region change; success!" << LL_ENDL;
+ }
+ mute_list->loadFromFile(mute_list->getCacheFilename(gAgent.getID()), MLS_SERVER_CACHE);
}
void LLMuteList::onFileMuteList(void** user_data, S32 error_code, LLExtStat ext_status)
@@ -1004,6 +1024,11 @@ void LLMuteList::setLoaded(EMuteListSource source)
mLoadSource = source;
notifyObservers();
LL_INFOS() << "Mute list loaded from " << sourceToString(source) << LL_ENDL;
+ if(isLoadedFromServer() && mRegionChangedCallback.connected())
+ {
+ LL_INFOS() << "Mute list loaded from server, disconnecting region change callback" << LL_ENDL;
+ mRegionChangedCallback.disconnect();
+ }
}
void LLMuteList::notifyObservers()
@@ -1032,6 +1057,23 @@ void LLMuteList::notifyObserversDetailed(const LLMute& mute)
}
}
+void LLMuteList::onRegionChanged()
+{
+ // If we are in a degraded state, either some protocol messages got lost between us and our login region, or our login region was having a bad day.
+ // Since the previous region might've been unable to provide our mute list, we can try to request it again from our new region.
+ // This is limited to one retry per session.
+ if(isLoadedDegraded() && !mTriedRegionChangeRetry)
+ {
+ if(mRegionChangedCallback.connected())
+ {
+ mRegionChangedCallback.disconnect();
+ }
+ LL_WARNS() << "Region changed while mute list is in degraded state, queueing a retry of the mute list request" << LL_ENDL;
+ mTriedRegionChangeRetry = true;
+ requestFromServer(gAgent.getID());
+ }
+}
+
LLRenderMuteList::LLRenderMuteList()
{}
diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h
index ff010a02e8..2781e9b177 100644
--- a/indra/newview/llmutelist.h
+++ b/indra/newview/llmutelist.h
@@ -31,6 +31,8 @@
#include "lluuid.h"
#include "llextendedstatus.h"
+#include <boost/signals2/connection.hpp>
+
class LLViewerObject;
class LLMessageSystem;
class LLMuteListObserver;
@@ -124,8 +126,13 @@ public:
static bool isLinden(const std::string& name);
- bool isLoaded() const { return mLoadState == ML_LOADED; }
- bool isFailed() const { return mLoadState == ML_FAILED; }
+ // Load state accessors.
+ bool isLoaded() const { return mLoadState == ML_LOADED; } // Loaded, but not necessarily from server.
+ bool isFailed() const { return mLoadState == ML_FAILED; } // Unable to load any mute list. Server did not reply.
+ // Loaded from server, which is the only source we consider authoritative.
+ bool isLoadedFromServer() const { return isLoaded() && (mLoadSource == MLS_SERVER || mLoadSource == MLS_SERVER_EMPTY); }
+ // Loaded, but from cache. Would be nice to upgrade to a server load from here if possible.
+ bool isLoadedDegraded() const { return isLoaded() && !isLoadedFromServer(); }
// Advance the load state machine, trying cache fallback if necessary.
// Return value indicates mute list consumption readiness.
@@ -139,6 +146,9 @@ public:
// call this method on logout to save everything.
void cache(const LLUUID& agent_id);
+ // Handler for region change event, used for server request retries if isLoadedDegraded() is true
+ void onRegionChanged();
+
private:
void clearCachedMutes();
bool loadFromFile(const std::string& filename, EMuteListSource source);
@@ -198,6 +208,8 @@ private:
EMuteListSource mLoadSource;
F64 mRequestStartTime;
bool mTriedCacheFallback;
+ bool mTriedRegionChangeRetry;
+ boost::signals2::connection mRegionChangedCallback;
friend class LLDispatchEmptyMuteList;
};