Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable filters for delete events #53

Closed
w3b6x9 opened this issue Aug 23, 2022 · 11 comments · Fixed by #76
Closed

Enable filters for delete events #53

w3b6x9 opened this issue Aug 23, 2022 · 11 comments · Fixed by #76
Assignees

Comments

@w3b6x9
Copy link
Member

w3b6x9 commented Aug 23, 2022

Feature request

Is your feature request related to a problem? Please describe.

I want to be able to filter delete events based on primary key(s) and when replica identity is set to full, filter based on all columns available in database table.

Describe the solution you'd like

For DELETE events:

  • when I want to filter by a column that is not available in old_columns, then the subscriber is ignored.
  • when replica identity is not full, only filters referencing the pk column(s) are respected.
  • when replica identity is full, filters referencing any column in the table are respected.

Additional context

@roobox
Copy link

roobox commented Nov 12, 2023

I am really desperately waiting for this feature!

@Zeulni
Copy link

Zeulni commented Nov 12, 2023

Stumped upon that, need the same feature for my team!

@christophemenager
Copy link

Thanks for opening this issue @w3b6x9.

This should be at least clearly documented, it created a major in production for my mobile app...

@andy-leezard
Copy link

Hello, are we getting any official fix on this matter soon?

@w3b6x9
Copy link
Member Author

w3b6x9 commented Feb 16, 2024

This should be at least clearly documented, it created a major in production for my mobile app...

@christophemenager great call, i'll let our Realtime team know and we'll add it to our docs.

@gsw85
Copy link

gsw85 commented Mar 6, 2024

The UPDATE event ignoring filter as well

@Stiffjobs
Copy link

The UPDATE event ignoring filter as well

Mine is working on UPDATE event

@georgii-ivanov
Copy link

Can we just filter by old record ID? So we know it, just implementing that filter would be helpful

@alexeigs
Copy link

It basically means you can't listen to the deletion of any user records currently because you'd subscribe to all deletion events on this table across the entire user base, right?

I hope there's a fix or a recommended workaround added to the documentation given it's a major challenge everyone using realtime capabilities may face.

@cphoover
Copy link

cphoover commented Jun 28, 2024

I really think that the limitations to realtime... such as this... such as the limitations on filtering multiple columns... such as the scaling issues related to listening to postgres_changes... should preclude supabase from being marketed as a realtime db...

These limitations really make using subscriptions to db changes useless for most real world applications.

I understand you can have a server that consumes postgres_changes and then emits with broadcast... but ideally these features would exist baked into the framework without having to host an additional server layer.

@upnorth
Copy link

upnorth commented Feb 6, 2025

FYI. I solved this with a workaround. I made a pretty unique key (to avoid conflicts with user data) for deletes that my app can look for and ignore, and just trigger changes to the local state with. So my users can add stuff which then gets propagated to all sessions, but if they want to clear the state, I send both a delete command and an insert command after. delete nukes the user content in the db, and the insert triggers a subscription event to all sessions to clear the local state. Kind of messy, but it works. Depending on your use-cases it might be enough so you don't have to switch to an entirely new solution until Supabase figured this out?

EDIT: Just noticed that this was specifically for filters. But I didn't get any delete events at all when I debugged my app, so hence my workaround. Hopefully it can still be useful to someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.