Supabase Cost Stability Performance

Realtime channel never unsubscribed — connection leak

Part of the Realtime & cost check · fix arrives as a pull request

What it is

A Realtime channel is subscribed in a component effect with no cleanup calling removeChannel().

Why it matters

Every mount opens a subscription that is never closed. Navigating around the app accumulates connections until the client hits the concurrent limit, and each one is billed while it lives.

How to fix it

Return a cleanup function from the effect: return () => { supabase.removeChannel(channel) }. Confirm it by navigating away and back and watching the connection count stay flat.

Run them all on your app

Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.