From c5a0f8cf94cafe7783a633ba0b01cf6b4378e738 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Wed, 14 Jan 2026 16:32:13 +0530 Subject: [PATCH] refactor(03-03): remove diagnostic logging after fix verified - Remove all [RENDER], [EFFECT], and [DEBUG] console logs - Keep only error logging for production - Player now loads successfully in popup mode Co-Authored-By: Claude Sonnet 4.5 --- .../client/JKSessionBackingTrackPlayer.js | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/jam-ui/src/components/client/JKSessionBackingTrackPlayer.js b/jam-ui/src/components/client/JKSessionBackingTrackPlayer.js index 44535edcc..9ca7015ee 100644 --- a/jam-ui/src/components/client/JKSessionBackingTrackPlayer.js +++ b/jam-ui/src/components/client/JKSessionBackingTrackPlayer.js @@ -92,24 +92,11 @@ const JKSessionBackingTrackPlayer = ({ // Specific retry logic handled by individual operations }, [clearError]); - // Debug: Log component state - console.log('[RENDER] Component rendered with:', { - isOpen, - hasBackingTrack: !!backingTrack, - hasJamClient: !!jamClient, - backingTrack, - isLoadingDuration - }); - useEffect(() => { - console.log('[EFFECT] Duration useEffect triggered', { isOpen, isPopup, hasBackingTrack: !!backingTrack, hasJamClient: !!jamClient }); - // For popup mode, treat as always "open" since the popup window itself indicates open state const shouldInitialize = (isOpen || isPopup) && backingTrack && jamClient; - console.log('[EFFECT] Should initialize?', shouldInitialize); if (shouldInitialize) { - console.log('[EFFECT] Condition passed, initializing...'); // Initialize player state when opened setIsPlaying(false); setCurrentTime('0:00'); @@ -118,22 +105,17 @@ const JKSessionBackingTrackPlayer = ({ // Fetch and set duration immediately when track loads (async) const fetchDuration = async () => { setIsLoadingDuration(true); - console.log('[DEBUG] Fetching duration...'); try { if (!jamClient) { - console.log('[DEBUG] No jamClient available'); handleError('general', 'Audio engine not available', null); setIsLoadingDuration(false); return; } - console.log('[DEBUG] Calling SessionGetTracksPlayDurationMs...'); const durationInMs = await jamClient.SessionGetTracksPlayDurationMs(); - console.log('[DEBUG] Duration received:', durationInMs, 'Type:', typeof durationInMs); // Convert string to number (jamClient returns string values) const validDuration = parseInt(durationInMs, 10) || 0; - console.log('[DEBUG] Parsed duration:', validDuration); // Check for invalid duration (file error) if (validDuration === 0 || isNaN(validDuration)) { @@ -149,14 +131,11 @@ const JKSessionBackingTrackPlayer = ({ const oneSecondMs = 1000; // Validation logic exists but logs removed for production - console.log('[DEBUG] Setting duration to:', validDuration, 'formatted:', formatTime(validDuration)); setDurationMs(validDuration); setDuration(formatTime(validDuration)); clearError(); // Clear any previous errors setIsLoadingDuration(false); - console.log('[DEBUG] Duration fetch complete, loading set to false'); } catch (error) { - console.log('[DEBUG] Error fetching duration:', error); handleError('file', 'Failed to load track duration', error); setDuration('0:00'); setDurationMs(0);