Skip to content
This repository was archived by the owner on Nov 20, 2026. It is now read-only.

fix: count a near-miss usage-reporting opt-out as off - #73

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/usage-reporting-near-miss-opt-out
Nov 19, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
fix/usage-reporting-near-miss-opt-out

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

What

An opt-out written in settings.json under another spelling is now counted as off:

  • a block named usage-reporting, usageReporting, UsageReporting (any key that normalises to "usagereport") holding a value, or an enabled-like switch, that is not clearly on;
  • inside any such block, an enable / Enabled switch that is not clearly on, or a disabled switch that is on.

On a first run over such a file, "usage_reporting": {"enabled": false} is written next to the operator's block (instead of the default block with enabled: true) and an "off" notice (FIRST_RUN_NOTICE_OFF_BY_SETTINGS) is printed instead of the "on" one. A hasNearMissOptOut helper (a port of the one in Dans-Plugins/Medieval-Roleplay-Engine#418) does the detection through the vendored client's allows_reporting.

Why

A real-server repro showed that an opt-out written under another spelling was not recognised: it was treated as missing, the default block was written with reporting on, and the program reported. Reference fix: Dans-Plugins/Medieval-Roleplay-Engine#418

Tests

New tests cover nine near-miss opt-outs (each builds a disabled client and shows no "on" notice), five near-miss spellings that say on (each still enabled), and a first run over a near-miss opt-out (real switch written off, operator's block kept, off notice). README updated.

python -m unittest discover -s tests: 263 tests, OK.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE


drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
@dmccoystephenson
dmccoystephenson merged commit c5c2584 into main Nov 19, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the fix/usage-reporting-near-miss-opt-out branch November 19, 2026 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant