Repository navigation
fix: count a near-miss usage-reporting opt-out as off - #31
Merged
Merged
Conversation
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
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.
What
An opt-out written in
settings.jsonunder another spelling is now counted as off:usage-reporting,usageReporting,UsageReporting(any spelling of "usage reporting") holdingfalse/"off"or"enabled": false;"enable": false,"Enabled": false, or"disabled": true(even next to"enabled": true).hasNearMissOptOutis added tosrc/usage_reporting.pyand checked inloadSettings. When the realusage_reportingblock is missing, it is now written with"enabled": falsenext 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#418Tests
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