chore: remove dead code and fix stale comments#322
Merged
Conversation
1bbec67 to
03bcaec
Compare
- Remove clearAsyncNamespaceEntry() — unused after cls-hooked migration;
AsyncLocalStorage stores are GC'd automatically, no manual clearing needed
- Fix logFn direct call in catch block — route through this.log() which
guards against undefined logFn instead of throwing TypeError
- Replace CLS-era terminology in comments: "continuation local storage
machinery" / "async namespace" → "async context"
- Remove orphaned JSDoc block left above createAgentForExistingSocket
after clearAsyncNamespaceEntry was deleted
- Remove misleading "If the socket path exists..." comment that didn't
describe the code below it
- Fix typos in comments: curernt, stoped, bfore, likey, perofrming,
midleware, then then, ScoutOptsuration, correposnding
- Fix truncated JSDoc sentence ("has been" → "has been sent")
- Fix duplicate JSDoc text in sendTagSpan
- Fix log message in sendThroughAgent: "not sending tag request" →
"not sending request" (function handles all request types)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
03bcaec to
d530c30
Compare
quinnmil
approved these changes
May 29, 2026
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.
Summary
clearAsyncNamespaceEntry()was unused after the cls-hooked → AsyncLocalStorage migration. AsyncLocalStorage stores are GC'd automatically so there's nothing to manually clear.logFnwas called directly in acatchblock, throwingTypeError: this.logFn is not a functionwhen no logger was configured (issue TypeError: this.logFn is not a function #275). Now routes throughthis.log()which guards against undefined.clearAsyncNamespaceEntrywas left sitting abovecreateAgentForExistingSocket— removed.curernt,stoped,bfore,likey,perofrming midleware,then then,ScoutOptsuration,correposndingacrosslib/scout/index.ts,lib/express.ts,lib/integrations/express.ts,lib/global.ts.sendTagSpan, and wrong log message insendThroughAgent("not sending tag request" → "not sending request").Test plan
tsccompiles cleanlyclearAsyncNamespaceEntryhas no callers (grepreturns nothing)this.logFn is not a functionerror is no longer reproducible when nologFnis passed tonew Scout()🤖 Generated with Claude Code