Open
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
After some time working in an app, that uses supabase Realtime, supabase seems to clear postgres subscriptions automatically. Therefore, the user doesn't get any updates.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Simple Subscription Code snippet for solid-js. (Supabase Auth works in here).
const subscribe = siqn.supabase?.channel(`db-public-calculation_items-${calculationId}`)//.channel(`db-public-calculation_items-${calculation().id}`)
.on("postgres_changes", {
event: "*",
schema: "public",
table: "calculation_items",
filter: `calculation_id=eq.${calculationId}`,
}, (payload: any) => {
switch (payload.eventType) {
case "INSERT":
setCalculationItems(prev => [...prev, mapCalculationItemFromPostgres(payload.new)]);
updateSum();
break
case "UPDATE":
setCalculationItems(prev => prev.map((item) => item.id === payload.new.id ? mapCalculationItemFromPostgres(payload.new) : item));
updateSum();
break
case "DELETE":
setCalculationItems(prev => prev.filter(i => i.id !== payload.old.id));
updateSum();
break
}
})
.subscribe();
Expected behavior
Why does that happen? Maybe a small disconnect from internet? Or something with the accessToken? Do I have to add manual reconnects to the subsciption?
Screenshots
System information
- OS: macOS
- Browser (if applies): Safari
- Version of supabase-js: 2.46.1
- Version of Node.js: 18
Additional context
Add any other context about the problem here.