Repository navigation
fix: keep usage reporting off once it is turned off - #657
Merged
Merged
Conversation
Re-vendor trace-client-python 0.5.0 (every opt-out fails closed) and make Roam's own switches fail closed too: - usageReportingEnabled is read with allows_reporting(): off/no/0/"false"/blank no longer fall back to the default (on) - a config.yml that cannot be read in full is off, and _writeKeyValues no longer replaces a file it could not read - ROAM_USAGE_REPORTING fails closed like TRACE_USAGE_REPORTING 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 Roam's own config handling.
Changes
src/lib/trace_client.pyis updated from trace-client-python 0.4.1 to 0.5.0 (Make every opt-out fail closed (0.5.0) Stephenson-Software/trace-client-python#45), 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. The vendored test suite is updated to match (the two package-layout tests, which readpyproject.tomland the package__init__, are left out because a single vendored module has neither).usageReportingEnabledwas read withgetBoolValue, so anything but a baretrue/false(off,no,0,"false", a blank value) fell back to the default and reported, silently, because the line's presence also suppressed the first-run notice. It is now read with the client'sallows_reporting(): onlytrue,on,yesor"true"reports.config.ymlthat could not be read in full (e.g. a byte that is not UTF-8) was read as the defaults (on), and the first-run notice then rewrote the file from nothing, leaving onlyusageReportingEnabled: true. Reporting is now off in that case, and_writeKeyValues(also used for window-size saves) no longer writes over a file it could not read.ROAM_USAGE_REPORTINGonly turned reporting off for 0/false/off/no, so a value such asdisabledleft it on. It now fails closed likeTRACE_USAGE_REPORTING.Tests
python -m black --check src tests(black 23.1.0): clean.python -m pytest(Python 3.12): 2212 passed.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson