Repository navigation
fix: keep usage reporting off once it is turned off - #96
Merged
Merged
Conversation
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]>
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.
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.hppis 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_REPORTINGset to anything but blank/true/on/yes/1, orDO_NOT_TRACKset to anything but blank/0/false/off/no, turns reporting off.usageReporting.h:enabled=inusage-reporting.confwas on unless it read exactly false/off/no/0, so a typo, a blank value orenabled=disabledreported. It is now read withtrace_client::allowsReporting(): only true/on/yes/1 reports.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.Tests
disabledas off; new tests cover an unreadable settings file andenabled=disabledend to end. The environment test that expectedTRACE_USAGE_REPORTING=disabledto 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