-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Context & Impact
There are 41+ console.log and console.error statements scattered across the production codebase — in services, hooks, components, and providers. These include sensitive debug output like console.log('Creating stream', params), console.log('Distributing', params), and console.log('Fetching stream ${streamId}'). This data is visible in any user's browser DevTools.
Why this matters: Debug logging in production leaks implementation details, transaction parameters, and internal state to anyone who opens the browser console. In a financial application, this is both a security concern and a sign of incomplete release hygiene. It also clutters the console, making legitimate error tracking harder.
Scope
- Audit and remove all
console.logstatements from production code - Replace critical
console.errorcalls with proper error handling (toasts, error boundaries, or error reporting) - Keep only intentional, structured logging (if any) behind a debug flag or environment check
- Ensure no transaction parameters, wallet addresses, or internal state are logged in production
Implementation Guidelines
- Search the entire
apps/web/src/directory forconsole.log,console.warn,console.error, andconsole.debug - For each occurrence, decide: remove entirely, replace with toast notification, or guard behind
process.env.NODE_ENV === 'development' console.errorin catch blocks should be replaced with user-facing error handling (see error notification issue)- Consider adding an ESLint rule (
no-console) to prevent future regressions - Do NOT remove logging from test files — only production source code
Acceptance Criteria
- Zero
console.logstatements remain inapps/web/src/(excluding test files) - All
console.errorin catch blocks are replaced with proper error handling or guarded behind dev check - No transaction parameters, wallet addresses, or stream IDs are logged in production
- An ESLint
no-consolerule is configured (withwarnlevel) to prevent future regressions - The app functions correctly after removal — no logic depended on console side effects
- Test files are unaffected
Getting Started
- Run
grep -rn "console\.\(log\|error\|warn\|debug\)" apps/web/src/ --include="*.ts" --include="*.tsx" | grep -v "test\."to find all instances - Categorize each: remove, replace with toast, or guard behind dev check
- Start with
services/stellar.service.ts(largest concentration) - Move to hooks, then components, then providers
- Add
no-consolerule toeslint.config.mjs - Run
pnpm buildandpnpm lintto verify nothing is broken - Test core flows (stream creation, distribution, wallet connect) to confirm no regressions
PR Submission Guide
This section applies to every PR for this issue. Follow it exactly.
Before You Start
- Pull the latest
mainbranch:git checkout main && git pull origin main - Create your feature branch from
main:git checkout -b fix/<issue-number>-remove-console-logs
While Working
- Make atomic commits — one concern per commit, each commit must build
- Use Conventional Commits:
feat(scope): description,fix(scope): description - Keep your branch up to date:
git pull origin main --rebaseregularly
Before Submitting the PR
- Pull latest
mainand rebase:git checkout main && git pull origin main && git checkout <your-branch> && git rebase main - Ensure the build passes:
pnpm build - Ensure linting passes:
pnpm lint - Record a screen recording of your implementation showing the feature/fix working in the browser. Attach it to the PR.
PR Requirements
- Link this issue in your PR description using
Closes #<issue-number> - Fill out the full PR template — Summary, What Was Implemented, Implementation Details, How to Test
- Attach your screen recording demonstrating the implementation
- Request a review from a maintainer
PRs without a screen recording or without a linked issue will not be reviewed. Failure to meet PR requirements may lead to PR rejection.