Skip to content

🐞[Bug]: Unguarded console.log/error/warn statements leaking into production builds #1257

Description

@Deepakchwdhry

Related Area

Frontend

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Production source code mein 60+ files mein console.log(), console.error(), aur console.warn() statements bina DEV guard ke hain.

Iska matlab ye logs production builds mein bhi run hote hain, jo:

  • App performance degrade karta hai (especially Android)
  • Sensitive data leak ho sakti hai (FCM tokens, API responses, user data)
  • Sentry jaise crash reporters mein unnecessary noise create karta hai

Affected files include:

  • src/components/ArticleCard.tsx (15+ unguarded logs)
  • src/components/CreatePlaylist.tsx
  • src/screens/NotificationPreferencesScreen.tsx
  • src/hooks/useGetAllPodcasts.ts
  • ...and 55+ more files

Expected behavior

All console statements should be wrapped with DEV guard so they only run in development builds:

// ❌ Current (runs in production too)
console.log('Article like success', data.likeStatus);

// ✅ Expected (only runs in dev)
if (DEV) console.log('Article like success', data.likeStatus);

Add ScreenShots

No response

What browsers are you seeing the problem on?

No response

Record

  • I have read the Contributing Guidelines
  • I'm a GSSOC'24 contributor
  • I'm a GSSOC'26 contributor
  • I'm a IEEE IGDTUW contributor
  • I want to work on this issue

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions