Repository navigation
Test that unsent reports are not logged and non-number values are omitted - #6
Merged
Merged
Conversation
…tted The README promises that a report which was never going to be sent -- a disabled or closed client, or a blank or non-string name -- is not passed to debug, but no test supplied a debug callback on those paths, and a non-string name was never exercised. Nor was the rule that a value which is not a number is left out of the body. Two characterization tests now pin both; trace-client.ts is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on CI run 37107251970 at head
Judgment calls:
Summary: a test-only, low-risk PR, ready for human review. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Stage B (unit-test expansion) cycle:
report()'s input-guard branches.trace-client.tsis unchanged.Summary
logs nothing for a report that was never going to be sent: README.md (the "Options and limits" section) promises that "A report that was never going to be sent is not logged: a disabled or closed client, or a blank or non-stringname." The existing tests for those paths either passed nodebugcallback (sends nothing when disabled or without a key,ignores a blank name) or never exercised a non-stringname. The new test covers a disabled client, a keyless client, blank names, the non-strings42/undefined/null, and a report afterclose(), and asserts that both the server and thedebuglog are empty.omits a value that is not a number:serialize()keepsvalueonly whentypeof value === "number"and it is finite. NaN and the infinities were already tested; a string,nulland a boolean were not. The new test asserts that each is sent withoutvalue.No tracking issue: this gap was found during triage, and the backlog had no open issues.
While writing these tests,
report(name, null)was found to drop the event with a misleadingcould not serializedebug line. Per the test-expansion rule that production code is not changed in a characterization cycle, it was filed as #5 rather than fixed or pinned here.Test plan
testjob (npm ci,npm run typecheck,npm teston Node 22) is green on the PR head. Node is not installed in the authoring sandbox, so the tests were not run locally. CI is the only anchor.Cross-client and changelog
CHANGELOG.mdentry, because nothing a consumer vendors changed.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code