Skip to content

fix: guard console logs in MMKVUtils, Utils, and ArticleScreen with __DEV__#2106

Open
PARNITA-SINGH wants to merge 4 commits into
SB2318:mainfrom
PARNITA-SINGH:fix/debug-log-guard
Open

fix: guard console logs in MMKVUtils, Utils, and ArticleScreen with __DEV__#2106
PARNITA-SINGH wants to merge 4 commits into
SB2318:mainfrom
PARNITA-SINGH:fix/debug-log-guard

Conversation

@PARNITA-SINGH

@PARNITA-SINGH PARNITA-SINGH commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR Description

While auditing the MMKV storage layer, several console.log/console.warn/ console.error calls were found executing in both dev and prod builds with no guard, leaking storage keys, error types, and fallback strategy details to system logs. Most other logging in the codebase was already guarded, making this an inconsistency.

Added a centralized debugLog helper (frontend/src/utils/debugLog.ts) that wraps console.log, console.warn, and console.error behind an __DEV__ check, so log output is automatically stripped from production builds by Metro's dead-code elimination.

Replaced all 17 flagged unguarded console calls across:

  • MMKVUtils.ts (lines 48, 73, 99, 112, 129, 132, 145, 160)
  • Utils.ts (lines 93, 101, 109, 133, 135)
  • ArticleScreen.tsx (lines 238, 349, 390, 420)

with calls to debugLog / debugWarn / debugError as appropriate per call site.

Type of Change

  • Bug fix (change which fixes an issue)

Select your work-area

  • Frontend

Fixes

#fixes1952

Add your Work Example

📷
Screenshot 2026-07-11 014626

Checklist

  • I have updated my branch and synced it with the project's 'develop' branch before making this PR.
  • I have optimized the file changes.
  • I have made a PR to the project's develop branch.

Undertaking

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have checked for plagiarism and assure its authenticity.
  • I have read and followed the code of conduct for this repository. I understand that violation of this undertaking may have legal consequences.
  • I Agree

@github-actions

Copy link
Copy Markdown
Contributor

Thank you @, for creating the PR and contributing to our UltimateHealth project 💗.
Our team will review the PR and will reach out to you soon! 😇
Make sure that you have marked all the tasks that you are done with ✅.
Thank you for your patience! 😀

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR Validation Failed

This PR was marked as gssoc:invalid because: You are not the author or an assignee of the linked issue(s).

To resolve this, please ensure your PR description links an issue (e.g., Fixes #123) and that you are either the creator or an assignee of that issue.

@PARNITA-SINGH

PARNITA-SINGH commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @SB2318 ,

I had previously commented on this issue requesting to be assigned, but it has been open for several days and the other participant appears to have been inactive for the past 4–5 days.
In the meantime, I completed the implementation and submitted my PR. I've rechecked the changes thoroughly, and everything looks good from my end. The PR is ready for review and merge whenever you have a chance.

I would also like to request that the gssoc:invalid label be removed from my PR if possible. The work is complete and aligns with the issue requirements, and keeping that label on the PR may negatively affect my contribution record and reputation. If there are any changes required, I'd be happy to address them.

Thank you for your time and consideration!

@SB2318

SB2318 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Hi @SB2318 ,

I had previously commented on this issue requesting to be assigned, but it has been open for several days and the other participant appears to have been inactive for the past 4–5 days. In the meantime, I completed the implementation and submitted my PR. I've rechecked the changes thoroughly, and everything looks good from my end. The PR is ready for review and merge whenever you have a chance.

I would also like to request that the gssoc:invalid label be removed from my PR if possible. The work is complete and aligns with the issue requirements, and keeping that label on the PR may negatively affect my contribution record and reputation. If there are any changes required, I'd be happy to address them promptly.

Thank you for your time and consideration!

Don't worry, I recheck for every PR whether they invalid or not.

@PARNITA-SINGH

Copy link
Copy Markdown
Contributor Author

Hi @SB2318, the PR is ready for review and has been thoroughly checked from my end. Everything is in order, and it's ready to be merged when you have a chance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants