supabase: Realtime DELETE updates not being fired
Bug report
Describe the bug
listening to DELETE events:
const bp = await this.$supabase
.from("blogPosts")
.on("DELETE", (payload) => {
console.log(payload)
})
.subscribe()
Deleting a row in the ‘blogPosts’ table (manually from the Supabase Studio) doesn’t fire a DELETE event in the frontend.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a DELETE listener for a table
- Go to the Supabase Studio
- Delete a row from the table
- No DELETE event is fired as expected
Expected behavior
A DELETE event is fired and is shown in the console (console.log)
System information
- OS: macOs
- Browser: chrome
- Version of supabase-js: 1.29.1
- Version of Node.js: 16.13.0
Additional context
- Running locally (docker self-hosted)
- Listening to other events (UPDATE, INSERT) work as expected
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (13 by maintainers)
I can confirm that after i re-cloned the repo today the issue was gone and i could listen to DELETE events today. realtime image version:
image: supabase/realtime:v0.19.3
.@w3b6x9 i’m not really sure why the issue is solved but i guess that you guys fixed it behind the scenes. Although, it might just have been a weird bug on my end and i just needed to start from fresh again). Anyways, thanks a lot to everyone who pitched in and helped!
The issue can be closed, unless you guys wants to further investigate what was going on.
@chipseater just wanted to confirm: did you have a primary key on your table prior to setting replica identity to full?
Hi, I had the same issue with DELETE events not being fired and I fixed it with the SQL query :
ALTER TABLE your_table REPLICA IDENTITY FULL
. I hope it helps !Can you set your table replica identity to full as mentioned here @rotemrevivo91?