Supabase Realtime Subscription with Ionic Vue: Subscription closes automatically after 10 seconds

Hey Guys!

I’m currently building an app with Ionic Vue and Supabase for data storage. Furthermore i used the supabase-js and realtime-js library.

I declared my database as being realtime and followed the documentation strictly. I also tested whether i am able to retrieve data with my supabase-client via the supabase realtime inspector, where i luckily saw that my client indeed retrieves data.
Nevertheless, when i instantiate a supabase subscription from within my “onMounted”-Hook like so:

subscriptionInserts.value = supabase
      .channel('schema-db-changes')
      .on(
          'postgres_changes',
          {
            event: '*',
            schema: 'public',
          },
          (payload) => console.log(payload)
      )
      .subscribe((status, err) => {
        if(err) console.log("SUBSCRIPTION ERROR:", err);
        else console.log("SUBSCRIPTION STATUS CHANGED:", status);
      })

I get this result in my browser console : SUBSCRIPTION STATUS CHANGED: SUBSCRIBED but every time after exactly 10 seconds it gets followed by this result: SUBSCRIPTION STATUS CHANGED: CLOSED

Does anybody have an idea why my connection is always closed after 10 seconds? Within those 10 seconds everything works fine, but no events are triggered anymore as soon as the 10 seconds expire.
I also tried realising my subscription within different hooks and listen to different events/tables. Nothing changed my issue.
I feel like this is either a VueJS problem or related to Ionic.

I’d very much appreciate your guys help. Thank you in advance! :slightly_smiling_face: