Repository navigation
fix: keep usage reporting off once it is turned off - #178
Merged
Merged
Conversation
Re-vendor trace-client-python 0.5.0 (every opt-out fails closed) and make apex's own switch fail closed too: - enabled is read with allows_reporting(), not bool(): "false"/"off" no longer report - "usage_reporting": false (not a block) is read as the switch, not as defaults - a settings.json that is not a JSON object is no longer rewritten with reporting on - a first run under TRACE_USAGE_REPORTING/DO_NOT_TRACK records enabled: false 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 Apex's own settings handling.
Changes
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).UsageReportingService:enabledwas read withbool(), so"enabled": "false"or"off"reported. It is now read with the client'sallows_reporting(): onlytrueor an on-string reports."usage_reporting": false(or any non-object) fell back to the default block, i.e. on. It is now read as the switch itself.settings.jsonholding valid JSON that is not an object was treated as empty, so the first-run block (on) was written over it. It now leaves reporting off and the file untouched."enabled": true, so a later run without the variable reported without the on-notice ever having been shown. It now records"enabled": false, and the notice says so.Tests
"enabled": false.python3 -m pytest tests: 608 passed, 3 skipped.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson