Skip to content

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

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 spelling of "usage reporting") holding false/"off" or "enabled": false;
  • inside the block, "enable": false, "Enabled": false, or "disabled": true (even next to "enabled": true).

hasNearMissOptOut is added to src/usage_reporting.py and checked in loadSettings. When the real usage_reporting block is missing, it is now written with "enabled": false next to the near-miss, and no "reporting is on" notice is printed.

Why

A real-server repro of a Bukkit plugin showed that such an opt-out was not recognised: the program treated the block as missing, re-added its default block with reporting on, and reported. Collide had the same blind spot: {"usage-reporting": {"enabled": false}} led to the default block being written with "enabled": true, and {"usage_reporting": {"enable": false}} was read as on. Reference fix: Dans-Plugins/Medieval-Roleplay-Engine#418

Tests

Three tests were added (near-miss opt-outs are off, near-miss names that say on stay on, a near-miss opt-out writes the real switch off). python -m unittest discover -s tests: 133 tests, OK. README updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE


drafted by Claude on behalf of Daniel Stephenson

An opt-out written in settings.json under another spelling (a "usage-reporting", "usageReporting" or "UsageReporting" block, a plain value under such a name, or "enable"/"Enabled"/"disabled" inside the block) was ignored: the default block was written next to it with "enabled": true and reporting stayed on. Each now counts as off, and the real block is written with "enabled": false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
@dmccoystephenson
dmccoystephenson merged commit eca768b into main Nov 19, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/usage-reporting-near-miss-opt-out branch November 19, 2026 14:51
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.

1 participant