Hi, I'm struggling with the delete subscription, ...
# off-topic
t
Hi, I'm struggling with the delete subscription, I have no idea why it isn't working. Been tryna debug for an hour now.
Copy code
js
  React.useEffect(() => {
    if (!room) {
      return
    }
    const onDeleteRoomSubscription = supabase
      .from<Room>(`rooms:id=eq.${room.id}`)
      .on('DELETE', () => {
        toast.success(`Room ${room.title} was deleted!`)
        push('/rooms')
      })
      .subscribe()

    return () => {
      supabase.removeSubscription(onDeleteRoomSubscription)
    }
  }, [push, room])


  const deleteRoom = async () =>
    await supabase.from<Room>('rooms').delete().eq('id', roomId).single()
I can delete a room, but the realtime stuff ain't happening, the code within the subscription, been console logging all over the place 😒
I have it enabled, the replication stuff
deleteRoom gets called, and then the subscription ain't firing...