ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
16 replies
DarthJarJar

Realtime not working properly

I have a simple subscription, but it only works like 60% the time. I have not yet been able to identify the specific cases where it fails, as of now it just seems to be random
Here's the code
 const mySubscription = supabase
  .from('testlist')
  .on('*', (payload) => {
    console.log('Change received!', payload)
    if (payload.eventType === "INSERT") {
      datalist = [...datalist, payload.new]
    } 
    if (payload.eventType === "DELETE") {
      console.log(datalist.indexOf(payload.old))
      removeFromDataList(payload.old.id)
      console.log(datalist)
      datalist = datalist
    }
    
  })
  .subscribe()
 const mySubscription = supabase
  .from('testlist')
  .on('*', (payload) => {
    console.log('Change received!', payload)
    if (payload.eventType === "INSERT") {
      datalist = [...datalist, payload.new]
    } 
    if (payload.eventType === "DELETE") {
      console.log(datalist.indexOf(payload.old))
      removeFromDataList(payload.old.id)
      console.log(datalist)
      datalist = datalist
    }
    
  })
  .subscribe()
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Realtime not working
SupabaseSSupabase / help-and-questions
4mo ago
Realtime not working
SupabaseSSupabase / help-and-questions
4y ago
Realtime subscriptions not working
SupabaseSSupabase / help-and-questions
8mo ago
realtime with v2 not working
SupabaseSSupabase / help-and-questions
4y ago