🚨 Realtime Broadcast Issue: Works Locally, Buffered in Production
Setup:
- Frontend: Next.js on Vercel - Backend: Node.js API on Railway - Supabase: Realtime broadcasts for progress updates - Use case: Broadcasting compliance check progress (10% → 30% → 60% → 90% → 100%)
Problem: Broadcasts are being buffered and delivered all at once in staging (which will be same issue on prod once release), but work perfectly in local development.
What Works :
- Local development: Progress updates arrive in real-time (10%, 30%, 60%, etc.) - WebSocket connection establishes successfully in both environments - All broadcasts eventually arrive (just buffered in production)
What Doesn't Work :
Staging: All broadcasts arrive at the same time at the end Progress bar jumps from 0% to 100% instantly WebSocket frames show all updates arriving within 42ms of each other
What I Tried: - Run Staging env locally both backend and frontend and it works as expected however when i tried it on the deployed staging frontend and backend it wasn't working. - Added all the necessary configs, enabled broadcast realtime, added RLS in realtime.messages
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.