https://supabase.com/ logo
Hi, I have hours, with this issue, realtime is sim...
# javascript
j
Hi, I have hours, with this issue, realtime is simply not working 😭 What I have done - Disable RLS on all my tables - Enable replication for all my tables It seems to be receiving the data correctly on the browser (as you can see in the image in the network tab) But my callback function is never called. this is my code
Copy code
jsx
  const [listener, setListener] = useState()

  useEffect(() => {
    if (typeof metrics === 'undefined') return
    if (typeof listener !== 'undefined') return
    console.log('added listener')

    setListener(
      supabase
        .from('metrics')
        .on('INSERT', (payload) => {
          alert('hola')
        })
        .subscribe((status) => {
          console.log({ status }) // Prints "CLOSED" then "SUBSCRIBED" and finally "CLOSED" idk why
        })
    )

    return () => {
      supabase.removeSubscription(listener)
      console.log('remove listener')
    }
  }, [metrics])
as you can see is, very simple, I already tried with a non state variable but still not working BTW, in my realtime schema, in the subscriptions table I DO have the subscription