I’m using supabase-js with a React app, implementing its realtime functionality to get real-time updates from the database in the UI. Overall it’s working great. Sometimes, though, the realtime channels will close (they stop working and I get a CLOSED
event).
When that happens, I’d like to reopen them. Before I do, though, I’m not sure if I should first unsubscribe from the closed channel (supabase.removeChannel()
). I’d assumed yes, but when I do that I get another CLOSED
event on the old channel, which makes me wonder if the removeChannel()
call is unnecessary (or even harmful).
Thanks!