supabase subscriptions not working
See original GitHub issueBug report
Describe the bug
Whilst running a script that is “subscribed” to the table. On inserting values directly into the table through app.supabase the event is not shown.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create project -> create new table -> set “Enable Realtime”
- Copy project url and project api key (anon public) from settings > api
- Here is simple script that creates subscription:
const { createClient } = require('@supabase/supabase-js');
const supabaseUrl = "...supabase.co" //project_url
const supabaseAnonKey = "xxx.xxx.xx-xxx" //project api key (anon public)
const supabase = createClient(supabaseUrl, supabaseAnonKey)
const mySubscription = supabase
.from('*')
.on('*', payload => {
console.log('Change received!', payload)})
.subscribe()
- run script (
node test.js
) - insert new row into table
Expected behavior
I would expect to see a print statement consisting of the newly inserted value into the table.
System information
- OS: Windows
- Browser (if applies): firefox
- Version of @supabase/supabase-js: ^1.35.4 (?)
- Version of Node.js: v17.8.0
Additional context
I’m sure the client is connecting because i can pull all the data using:
async function seeAllData(){
const { data: sales_data } = await supabase.from("test-table").select("*")
console.log("SALES DATA:", sales_data)
}
RLS is disabled. And looking at the replication section in databases, everything is toggled on. I feel like theres something simple I’m overlooking but I can’t figure out what.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Subscribe to database changes - Supabase
Subscribe to database changes. Listen to messages. Realtime is disabled by default for new Projects for better database performance and security.
Read more >Supabase Realtime not working - Reddit
When I try supabase realtime subscriptions with SupabaseEventTypes as update, insert, delete and others it works as expected, the callback ...
Read more >I can't get Supabase real-time listen to Postgres changes to work
VSCode warns me that Property 'subscribe' does not exist on type 'never' and the console.log never shows as I edit rows in my...
Read more >Supabase Subscriptions Just Got Easier - DEV Community
It just seems to me these are problems on the backburner and not at the top of the list to fix. Subscriptions to...
Read more >Subscribe to Database Changes using Supabase's Realtime ...
In this lesson, we'll improve on our simple API request to Supabase by turning it into a subscription: a live-updating query that automatically...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kandros This is another related issues with a solution mentioned… https://github.com/supabase/realtime-js/issues/169 The fix appears only to be in v2 client code for that one. Edit: also there are many things that can cause events not to get to the client. You might go to the Supabase Discord server or start a new issue and describe your conditions…
@saterus I think you reached out via support ticket and we resolved it for you. There’s an issue in the latest Realtime version (multi-tenancy) where we’re splitting by
:
which obviously broke based on your filter value.