Skip to content

Keep the last good hosted verification list on disk for chat names - #115

Merged
valzargaming merged 1 commit into
mainfrom
claude/project-thread-pb46bi
Nov 17, 2026
Merged

valzargaming merged 1 commit into
mainfrom
claude/project-thread-pb46bi

Conversation

@valzargaming

Copy link
Copy Markdown
Member

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 to hosted_verified_cache.json in 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.
  • New 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.
  • Unchanged on purpose: get(), the verified collection, admin/access file sync and every authority check still require a fresh hosted list. The cache never feeds those.
  • A missing or corrupt cache file is ignored (one warning) and never blocks boot; save failures are logged and never thrown.

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 refusing get(), the display fallback, a boot load that leaves verified empty, 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.
  • All 37 run: php steps of local-profile.yml, plus tests/verifier-integration.php, tests/windows/hosted-verifier.php, ooc-auto-relay.php, lobby-webhook.php and core-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

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
Copilot AI balanced review requested due to automatic review settings November 17, 2026 17:48
@valzargaming valzargaming self-assigned this Nov 17, 2026
@valzargaming
valzargaming merged commit 6dd10ec into main Nov 17, 2026
50 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copy link
Copy Markdown
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

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants