Andrii
05/25/2026, 3:01 PMAndrii
05/26/2026, 7:29 AMChiranjeet Mishra
05/29/2026, 3:40 AMChiranjeet Mishra
05/29/2026, 3:50 AMSessionViewer/index.tsx (lines 131-150)
The recording section simply doesn't render when recordingUrl is null/undefined — there's no loading spinner or "processing" message. When calls end, recordings take time to process before the URL is set. The UI shows nothing, which users interpret as "stuck loading."
Root Cause #2: Page Unresponsiveness
This is caused by a cascade of performance issues in the Supabase realtime subscription:
1. Overly broad subscription (useSupabase.ts lines 353-360): Every change to ANY call in the database triggers refreshSessions(), which fetches ALL calls with SELECT *
2. Expensive re-computation (Sessions/index.tsx lines 142-179): The items useMemo sorts/maps every session on every update — with thousands of calls, this blocks the main thread
3. Unsafe JSON.parse (SessionViewer/index.tsx line 89): JSON.parse(args) is called without checking if args is already an object, potentially throwing errors on every render
4. No audio element cleanup (SessionViewer/index.tsx lines 134-137): Audio elements aren't cleaned up on re-renders, leading to resource leaks
Recommended Fixes
1. Add a loading/processing state when recordingUrl is null
2. Update Supabase subscription to only patch the specific changed call (not refetch all)
3. Fix typeof args === 'string' ? JSON.parse(args) : args for safe parsing
4. Add audio element cleanup via useRef and useEffect