Skip to content

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

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

NearMissOptOut is added, and UsageReporter's Spring constructor now takes the Environment and passes false as the switch when any property source holds an opt-out under a name Spring does not bind to usage-reporting.enabled:

  • a key naming usage reporting that spells "enabled" another way (usage_reporting.enable, usage.reporting.enabled, USAGE_REPORTING_ENABLE, ...) whose value is not clearly on;
  • one that spells "disabled" (usage-reporting.disabled, USAGE_REPORTING_DISABLED, ...) whose value is on;
  • a value given to usage reporting itself (usage-reporting=false, USAGE_REPORTING=off) that is not clearly on.

Names Spring already binds to the switch (usageReporting.enabled, Usage_Reporting.Enabled, USAGE_REPORTING_ENABLED) are left to Spring, and TRACE_USAGE_REPORTING is left to the client.

Why

A real-server repro of a Bukkit plugin showed that an opt-out written under another spelling was not recognised and reporting stayed on. Parpt had the same blind spot for spellings outside Spring's relaxed binding: they were ignored and the default (true) applied. Reference fix: Dans-Plugins/Medieval-Roleplay-Engine#418

Tests

NearMissOptOutTest was added (near-miss opt-outs in a file and in the environment are off; near-miss names that say on, unrelated *.enabled=false properties and a blank TRACE_USAGE_REPORTING stay on; spellings Spring binds are read by Spring as the switch; the real switch is read as before). ./gradlew --offline test: 201 tests, 0 failures. README updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE


drafted by Claude on behalf of Daniel Stephenson

Spring binds only usage-reporting.enabled and its relaxed forms, so usage_reporting.enable=false, usage-reporting.disabled=true, usage-reporting=false, usage.reporting.enabled=false or USAGE_REPORTING=off were ignored and reporting stayed on. Each now counts as off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
@github-actions

Copy link
Copy Markdown

Test Results

201 tests  +4   201 ✅ +4   2s ⏱️ -1s
 26 suites +1     0 💤 ±0 
 26 files   +1     0 ❌ ±0 

Results for commit 3118148. ± Comparison against base commit d4b17a7.

@dmccoystephenson
dmccoystephenson merged commit 3522d1e into main Nov 19, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/usage-reporting-near-miss-opt-out branch November 19, 2026 14:52
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