Skip to content

fix: keep usage reporting off once it is turned off - #78

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed
Nov 19, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

A server operator reported usage reporting turning itself back on after being disabled. In gh-backup the program's own switch was fail-open, and that is fixed here along with the vendored client.

  • usage.reporting.enabled / USAGE_REPORTING_ENABLED was compared with !"false".equalsIgnoreCase(...), so only false turned reporting off: off, no, 0, a blank value or a typo left it on (and COMMANDS.md documented that). It is now read through TraceClient.allowsReporting: only true/on/yes/1 (any case) keeps reporting on, anything else turns it off.
  • docker-compose.yml: ${USAGE_REPORTING_ENABLED:-true} replaced an explicit blank value with true; it is now ${USAGE_REPORTING_ENABLED-true}. DockerComposeEnvironmentTest accepts both forms.
  • Vendored client: trace-client-java 0.7.0 -> 0.8.0 (Make every opt-out fail closed (0.8.0) trace-client-java#51, not yet released). TRACE_USAGE_REPORTING set to anything but blank or an on-value, DO_NOT_TRACK set to anything but blank or 0/false/off/no, or an unreadable environment, now turns reporting off. TraceClient.java and TraceClientTest.java are copied unmodified apart from the package line.
  • The first-run notice only writes a marker file and logs; it never changes the switch. No other re-enable path was found.
  • Tests that pinned the old behaviour (blankEnabledValueMeansOn..., onlyFalseTurnsReportingOff...) are rewritten to the fail-closed rules; new environment tests cover TRACE_USAGE_REPORTING/DO_NOT_TRACK values and that TRACE_USAGE_REPORTING=on does not override the program's own off.
  • README, CONFIG.md, COMMANDS.md, .env.example, docker-compose.yml and CHANGELOG (Fixed) updated.

Tests

  • mvn test: 300 tests, 0 failures, 0 errors, 1 skipped (pre-existing skip).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

usage.reporting.enabled / USAGE_REPORTING_ENABLED turned reporting off only
for "false": off, no, 0, a blank value or a typo all left it on. It is now
read through the trace client's allowsReporting helper and fails closed:
only true/on/yes/1 keeps reporting on. docker-compose.yml passes a blank
USAGE_REPORTING_ENABLED through rather than replacing it with true.

Re-vendors trace-client-java 0.8.0 (TraceClient + its tests), whose
TRACE_USAGE_REPORTING / DO_NOT_TRACK checks fail closed too. Tests that
pinned the old behaviour are updated; docs and CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson
dmccoystephenson merged commit 5479f1d into main Nov 19, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/opt-out-fails-closed branch November 19, 2026 05:57
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