Round 6 security review fixes: DRY debugLog, gate debugPrint#65
Round 6 security review fixes: DRY debugLog, gate debugPrint#65
Conversation
…indings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix LOW-21 (main.dart) and LOW-22 (todays_five_screen.dart) ungated debugPrint calls. Extract shared debugLog() helper in display_utils.dart that gates behind kDebugMode, replacing all 12 raw debugPrint call sites across auth_service, auth_provider, main, and todays_five_screen. Adds regression test scanning lib/ for ungated debugPrint. LOW-15 (Firestore rules) deferred for proper Firebase CLI setup later. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
test comment check |
Code reviewIssue 1 — Bug: "debugLog import present" test always passes vacuously File: The condition has two logical problems that make
Suggested fix: if (content.contains('debugLog(') &&
!content.contains('display_utils.dart')) {Issue 2 — Stale line reference in docs (CLAUDE.md: verify before documenting) File: Both references claim Per CLAUDE.md: "Verify before documenting. Before writing any factual claim in a doc, verify it exists in the codebase first... Do not rely on memory, TODO lists, or stale branch knowledge." Fix: update both occurrences of |
Fix no-op test condition in debugLog import check — was using impossible logic that always passed. Now correctly verifies files calling debugLog() import display_utils.dart. Update launchSafeUrl line references in SECURITY_REVIEW.md (166→174 after debugLog insert). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
debugLog()helper indisplay_utils.dartthat gatesdebugPrintbehindkDebugMode, preventing error details from leaking to Android logcat in release buildsif (kDebugMode) debugPrint(...)call sites acrossauth_service.dart,auth_provider.dart,main.dart, andtodays_five_screen.dartwithdebugLog()debugPrintcalls can be reintroducedTest plan
flutter analyze— 0 issuesflutter test— 1275 tests pass (6 new tests added)flutter build linux— builds successfully🤖 Generated with Claude Code