Repository navigation
Keep the last good hosted verification list on disk for chat names - #115
Merged
Merged
Conversation
When the hosted verified list is stale or unreachable, the chat relay now uses the last good list (in memory, or loaded from hosted_verified_cache.json at boot) to attach the author's Discord name, instead of sending plain text. The cache is display only: get(), the verified collection and every access, admin and authority check still require a fresh hosted list. A missing or invalid cache file is ignored and never blocks startup; save failures are logged, never thrown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WTP2UbZ584w2CXPdx7Vin
Member
Author
|
2026-11-17: Head 5f764cb admin-merged as 6dd10ec after local checks passed. The chat relay now uses a display-only cache of the last good hosted list (memory plus hosted_verified_cache.json) when the host is unreachable. Authority checks still need a fresh list. Ran admin-verification-refresh.php (37 assertions) and chat-moderation.php; the new checks fail without the change. Also ran all 37 local-profile.yml steps, verifier-integration.php and windows/hosted-verifier.php: all PASS. I'll check main CI. Unverified: a live boot with the host down. Generated by Claude Code |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Val · project thread
Follow-up to #114. Val asked for the bot to keep a cache for when the hosted list can't be reached.
Change
Verifier(hosted read-only mode) keeps a display-only copy of the last good hosted list. It updates in memory on each successful refresh and is written tohosted_verified_cache.jsonin the bot's file cache when it changes. At boot it is loaded from disk, so names work even if the host is down at startup.getDisplayItem()/cachedDisplayItem()/hasDisplayCache(). They are for display only.GameServer::__gameChatRelay: when the live list is unavailable it uses the cached list to attach the author's Discord name, and only falls back to plain text when there is no cache. Logged once per outage, with a message that says which case applies.get(), theverifiedcollection, admin/access file sync and every authority check still require a fresh hosted list. The cache never feeds those.Tests
php tests/local/admin-verification-refresh.php vendor/autoload.php: PASS (37 assertions). The new checks cover the saved file, the stale list still refusingget(), the display fallback, a boot load that leavesverifiedempty, and a corrupt file being ignored.php tests/local/chat-moderation.php vendor/autoload.php: PASS. The new checks cover the cached name being used and the once-per-outage log.run: phpsteps oflocal-profile.yml, plustests/verifier-integration.php,tests/windows/hosted-verifier.php,ooc-auto-relay.php,lobby-webhook.phpandcore-gameserver-fixes.php: PASS. The new checks fail without the source change.Not verified: a live boot with the host unreachable.
Generated by Claude Code