fix: remove console wrapping anti-pattern#5
Open
CodeMonkeyCybersecurity wants to merge 1 commit intomainfrom
Open
fix: remove console wrapping anti-pattern#5CodeMonkeyCybersecurity wants to merge 1 commit intomainfrom
CodeMonkeyCybersecurity wants to merge 1 commit intomainfrom
Conversation
Root cause: Console method wrapping violates UNIX Rule #8 (Build for Debuggability) - it risks infinite recursion, breaks DevTools expectations, adds performance overhead on every console call, and mutates global browser state. Solution: Rely on global error/rejection handlers only. The wrapConsole() method and captureDebugLogs flag have been removed entirely. Unhandled errors and promise rejections are still captured without intercepting console.* methods. Security posture is improved by avoiding interception of developer tooling while still capturing actionable runtime failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5 tasks
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
wrapConsole()) from error-collector.jserrorandunhandledrejectionhandlers as the only capture pointsRoot Cause
Console method wrapping (
console.error = ...) was problematic because it:Changes
wrapConsole()method (~50 lines)captureDebugLogsflag (unused without console wrapping)docs/runbooks/RUNBOOK-error-collection.mddocumenting the simplified error collection approachTest plan
npm testpasses (310 tests)console.error =orconsole.warn =assignments remain in.jsfilesUNHANDLED_ERROReventsUNHANDLED_REJECTIONevents🤖 Generated with Claude Code