Embracing additional Realtime insights and learning about potential pitfalls
Although you’ve learned the most important part of Realtime, it’s important to know that it can do more than just listen to the database. In this section, I won’t go into too much detail, but I’ll give you a few starting points to expand your own thoughts:
- Just like any other connection, a real-time connection can break (for example, because your Wi-Fi disconnects). In
.subscribe()
, you can pass a function to receive updates about the connection itself, like so:.subscribe((status) => console.log('connection status', status))
Herewith, if you’re notified with a status that isn’t
SUBSCRIBED
, you might want to consider resubscribing:
Figure 10.21: Realtime status values
- Deletions in the database ignore the given
filter
property due to technical constraints (https://supabase.com/docs/guides/realtime/postgres-changes...