v2 Realtime not working as expected.

Can I assume this is still not final until it's announced more in the following days?

This code sits in an rxjs stream where a new id is presented every time the route changes. I Unsubscribe from previous contact and re-sub to the new. But after I route away from an id and then back to the original it stops getting updates?

This seemed to be working fine withe the previous implementation

      this.realtime?.unsubscribe()
      this.realtime = this.ss.client
        .channel(`public:contact:id=eq.${contact.id}`)
        .on(
          'postgres_changes',
          {
            event: 'UPDATE',
            schema: 'public',
            table: 'contact',
            filter: `id=eq.${contact.id}`,
          },
          ({new: contact}) => {
            console.log('contact', contact)
            this.contact = contact
          }
        ).subscribe()

    "@supabase/supabase-js": "^2.0.0-rc.2",
Was this page helpful?