Skip to content

Mute list fallback to cache + retry on region change if still pending#5269

Draft
DarlCat wants to merge 1 commit intosecondlife:developfrom
DarlCat:bugfix/blocklist-fail-recover
Draft

Mute list fallback to cache + retry on region change if still pending#5269
DarlCat wants to merge 1 commit intosecondlife:developfrom
DarlCat:bugfix/blocklist-fail-recover

Conversation

@DarlCat
Copy link
Contributor

@DarlCat DarlCat commented Jan 14, 2026

Description

This PR aims to reduce user impact of unsent or dropped simulator messages during login regarding the mute list. The current behavior when this occurs is to have an empty mute list, and not fallback to cache even if it is present. This PR updates this behavior in the following ways:

  • fall back to the cached mute list on request timeout or transfer failure so the list never stays empty if we can help it
  • retry mute list requests on region change with a short cool-down to avoid being too noisy, if still in timeout window
  • cancel pending timeout once the list loads to stop unnecessary potential fallback behaviors
  • push an update to the blocked list people floater when a cached or deferred load populates the list
  • notify the user of a forced cache fallback because recent changes may be missing

Related Issues

https://feedback.secondlife.com/bug-reports/p/block-list-empties


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • The PR is linked to a relevant issue with sufficient context.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

I've tested this locally with success, however I am not able to test all platforms. Bugs based on packet loss are a challenge to reproduce so my testing was based on artificially induced drops. I do not think that this is a perfect solution as the existing comments in code suggest this would ideally be moved to a capability, but this is intended keep people from too much hardship until that more comprehensive effort can be prioritized.

Very much open to feedback and willing to make reasonable requested changes.

- fall back to the cached mute list on request timeout or transfer failure so the list never stays empty if we can help it
- retry mute list requests on region change with a short cooldwn to avoid being too noisy, if still in timeout window
- cancel pending timeout once the list loads to stop unnecessary potential fallback behaviors
- refesh the blocked list UI when a cached or deferred load populates it
- notify the user of a forced cache fallback because recent changes may be missing

Signed-off-by: Darl <me@darl.cat>
@github-actions github-actions bot added the c/cpp label Jan 14, 2026
return;
}
s_notified = true;
LLNotificationsUtil::add("MuteListFallbackCache");
Copy link
Contributor

@akleshchev akleshchev Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be shown to a user. At least in some cases it's a bug that needs to be fixed server side in others viewer should rerequest.

If viewer timeouts, got an empty list or errors getting the list, you probably can do something about it via MuteCRC field. But I agree that if something got wrong we at least should get the data from cache.

Or read cache first (issues with this approach if outdated?), mark as 'no send', apply server response on top...

P.S. Related: #4267

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be shown to a user.

I added a notification because I felt the user impact of potentially missing recent uncached mutes that the server could be aware of that we are not could be highly disruptive to the user. In a perfect world they should never see the notification because the replies to MuteListRequest are expected to arrive, but the user complaints about this I have seen are describing a great level of distress over harassment the mute list should prevent.

The notification will absolutely be removed if it's decided to not be acceptable. I felt it was appropriate at the time given the potential impact of missing mutes.

If viewer timeouts, got an empty list or errors getting the list, you probably can do something about it via MuteCRC field. But I agree that if something got wrong we at least should get the data from cache.

That is my thought, because for some unknown reason these messages are being lost or remain unsent at random for some users.

Or read cache first (issues with this approach if outdated?), mark as 'no send', apply server response on top...

The UpdateMuteListEntry and RemoveMuteListEntry messages both refer to mutes by their ID or name, so as far as I can tell there should be no negative impact on the server mute list if the user moves forward with a session of adding/removing mutes based on their cached copy. The client would just be missing the local record of what is on the server.

What I considered when deciding not to go for the cached data first, then layer on the server once (if?) we get it was the merging logic. If we were to load from cache first and later learn of a newer server version, it is not guaranteed to be reconcilable with what we have in our cache.

For merging the server list with the cached list, the assumptions I would have to make could potentially result in unintended re-mutes or unintended unmutes based on which we determine to be the correct state of a mute that is present vs not or different in one list compared to the other.


I was very anxious to repeatedly request a mute list from the region because I do not want to generate undue load with loops. There are two timeouts/cooldowns in place within my PR

  1. The existing conceptual 30 second timeout, after which for the duration of the session I completely rely on the cached mute list and stop caring about what the server may ultimately come back with to avoid merging or recreating the mute list, and stop any effort to re-request an update
  2. The 5 second cooldown between MuteListRequest dispatch attempts, which can be triggered by region change. This was to prevent asking every region an agent may be passing through for a mute list that they may not stay around long enough to receive.

Copy link
Contributor

@akleshchev akleshchev Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because for some unknown reason these messages are being lost or remain unsent at random for some users.

I will create a server ticket for that. I know at least one case with a repro where server isn't responding yet should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was very anxious to repeatedly request a mute list from the region because I do not want to generate undue load with loops.

Makes sense. But region change can end up requesting indefinetely either way. Better add some kind of retry limit there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because for some unknown reason these messages are being lost

SendReliable supports callbacks. Might be possible to refine this by detecting send failures to log better and to rerequest on failures.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements fallback mechanisms for mute list loading to improve reliability when simulator messages are lost or delayed during login. The changes add timeout-based cache fallback, retry logic on region changes, and better UI updates when cached data is used.

Changes:

  • Added timeout mechanism (30 seconds) to fall back to cached mute list if server request doesn't respond
  • Implemented retry logic on region changes with 5-second cooldown to avoid request spam
  • Added user notification when falling back to cached data
  • Enhanced blocked list UI to refresh when cached or deferred data loads

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
indra/newview/skins/default/xui/en/notifications.xml Added new notification to inform users when cached mute list is used due to server communication issues
indra/newview/llmutelist.h Added timer management, region change callback, and helper methods to support timeout and retry mechanisms
indra/newview/llmutelist.cpp Implemented timeout handling, cache fallback logic, region change retry, timer cleanup, and refactored cache loading
indra/newview/llblocklist.h Updated method signatures with override keywords for better code quality
indra/newview/llblocklist.cpp Implemented onChange() to detect and handle transitions from empty to populated mute list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +90 to +93
mShouldAddAll = true;
mActionType = NONE;
setDirty(true);
}
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onChange() implementation only handles the case where mMuteListSize transitions from 0 to a positive value. If the mute list size changes in any other way through a batch operation (e.g., from 10 to 15 items when cache loads), the UI will not update because the condition on line 88 will be false. Consider updating mMuteListSize at the end of this method or triggering a refresh whenever current_size != mMuteListSize, not just when transitioning from zero.

Suggested change
mShouldAddAll = true;
mActionType = NONE;
setDirty(true);
}
// Initial population of the mute list: add all existing entries.
mShouldAddAll = true;
mActionType = NONE;
}
// The mute list size has changed; mark the UI as needing refresh
// and update our cached size so future comparisons are correct.
setDirty(true);
mMuteListSize = current_size;

Copilot uses AI. Check for mistakes.
@akleshchev akleshchev linked an issue Jan 20, 2026 that may be closed by this pull request
@akleshchev
Copy link
Contributor

@Geenz What do you think about this one?
I think notification is not needed, but a fallback in case server failed to respond or caps failed is needed as a mitigation.

P.S. Created a server ticket, because that's where the problem comes from at least in some cases https://github.com/secondlife/server/issues/2305

@DarlCat
Copy link
Contributor Author

DarlCat commented Jan 20, 2026

I plan to be making an update to this PR that addresses feedback given, so unless the exact state it's in now becomes satisfactory it may be best set to draft.

There's excellent feedback here, and my mind is personally already changed that a notification isn't ideal for this when we can fail-safe and never alert or scare the user.

I'm working on an implementation for this PR that expands the state machine design already in place to integrate graceful retry logic, and use of the cache as a starting point rather than an eventual fallback. This approach makes a notification unnecessary in my opinion.

@akleshchev
Copy link
Contributor

akleshchev commented Jan 21, 2026

Thank you! Moved to draft.

@akleshchev akleshchev marked this pull request as draft January 21, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block list empties

2 participants