Skip to content

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

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

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

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Usage reporting is made to stay off once it has been turned off, in the vendored client and in usageReporting.h.

Changes

  • src/header/trace_client.hpp is updated from trace-client-cpp 0.3.0 to 0.4.0 (Make every opt-out fail closed (0.4.0) Stephenson-Software/trace-client-cpp#36), in which every opt-out fails closed: TRACE_USAGE_REPORTING set to anything but blank/true/on/yes/1, or DO_NOT_TRACK set to anything but blank/0/false/off/no, turns reporting off.
  • Fail-open paths fixed in usageReporting.h:
    • enabled= in usage-reporting.conf was on unless it read exactly false/off/no/0, so a typo, a blank value or enabled=disabled reported. It is now read with trace_client::allowsReporting(): only true/on/yes/1 reports.
    • A settings file that existed but could not be opened was treated as missing: the first-run file (enabled=true) was written over it and the on-notice printed. It now counts as present with reporting off, and is left alone. A read error part way through (or a directory at the path) also turns reporting off.
  • README opt-out section updated.

Tests

  • Parser tests now pin typos, blank and disabled as off; new tests cover an unreadable settings file and enabled=disabled end to end. The environment test that expected TRACE_USAGE_REPORTING=disabled to leave reporting on now uses an on-value instead.
  • make mb_tests && ./mb_tests: all tests passed (9213 assertions in 84 test cases).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Re-vendor trace-client-cpp 0.4.0 (every opt-out fails closed) and make
microbiome's settings file fail closed too:
- enabled is read with trace_client::allowsReporting(): a typo, a blank
  value or "disabled" is off, not on
- a settings file that exists but cannot be read (or fails part way) turns
  reporting off and is no longer replaced by the first-run file (enabled=true)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson
dmccoystephenson merged commit 0ba8200 into master Nov 19, 2026
4 of 5 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/opt-out-fails-closed branch November 19, 2026 05:59
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