- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersup for grabs
Description
Describe the bug
Right now, Supabase Realtime does not support multiple filters. If used, the live provider for supabase will send an invalid filter payload, causing the realtime request to fail.
Steps To Reproduce
- Create any realtime resource
- Add more than 1 filter to the resource (I was using a useList hook with multiple objects in the filters option)
- Watch websocket network requests, it will show an error.
Expected behavior
I think we should either log a warning if we see multiple filters, or naively take the first one?
Packages
- supabase realtime v2.30.34 (not latest, but also not fixed in latest)
- @refinedev/supabase 5.9.4
Additional Context
See here for Refine's implementation, where it is joining each filter with a comma.
See here for feature that is being discussed. No real activity it seems.
kater1naa
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersup for grabs
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
alicanerdurmaz commentedon Sep 23, 2024
Hello @amerryma,
Can you please give us the
full error logandfilters?alicanerdurmaz commentedon Sep 24, 2024
Hello @amerryma, thanks for the issue.
We discussed with the core team and decided not to add
filtersto the subscription since complex and relation-based filters might not work as expected in Supabase Realtime.After removing
filters, any change in thepoststable will trigger thepostsquery again, ignoring the filters. We believe this approach is correct. What do you think?amerryma commentedon Sep 24, 2024
My workaround for now was picking one filter that did 90% of the server side filtering then did the rest on the client side. So you're saying that you will remove the filtering altogether?
alicanerdurmaz commentedon Sep 25, 2024
I was wrong. In this use case, the filters must work. We'll investigate this issue and see what we can do.
We're currently considering showing a warning when multiple filters are used and allowing users to override the
liveProvider's filters using themeta.realtimeFiltersprop.amerryma commentedon Sep 25, 2024
I've also bumped an issue directly inside supabase/realtime to see what the status is there.
aliemir commentedon Oct 10, 2024
Until there are any updates in the supabase side, we should have this working without an error. Picking the first filter will work for many cases but it must be configurable (like
meta.realtimeFilter). When working with multiple filters, realtime subscription may log a warning (like @alicanerdurmaz stated) about the current issue and say that only the first filter is picked etc.If Supabase starts supporting multiple filters in the future, we can just deprecate the
realtimeFilterand revert back to the current state 🤔Maybe @alicanerdurmaz can provide a detailed description for the implementation we want and it will be a guide for anyone interested in working on this issue 🚀 🚀
alicanerdurmaz commentedon Oct 15, 2024
@amerryma @aliemir
I think it would be good to warn if there is more than one filter and allow the user to override the filter if needed.
Warning for Multiple Filters
If more than one filter is used, show a warning to user. If
meta.realtimeFilteris available, use that instead ofparams.filter.Code Link
Fix Filter Syntax Errors
There are some syntax errors in the generated filter. These need to be fixed and tested.
Skip Unsupported Filters
Some filters that work in Refine don't work with Supabase Realtime. Ignore those filters when generating for Realtime.
Supabase Realtime Docs
raja8287 commentedon Jan 2, 2025
Hey!
I want to work on this issue.
7 remaining items
akash-kumar5 commentedon Jul 9, 2025
Hey! I'd like to work on this issue.
Plan:
Does this sound good?
srajan07 commentedon Jul 17, 2025
Hi! I’m new to open source and I’d love to contribute to this issue. Can I work on this? Any additional context or guidance would be appreciated 🙌
alicanerdurmaz commentedon Jul 18, 2025
Hello @sajalshh,
Thanks a lot for your interest, we’d love to have your contribution!
Feel free to pick this up. If you have any questions while working on it, don’t hesitate to ask.
Please also check our contribution guide: https://refine.dev/docs/guides-concepts/contributing/
Looking forward to your PR! 🙌
fix: support multiple filters in Supabase Realtime (refinedev#6360)
sunillucky143 commentedon Aug 31, 2025
Is this ticket still open?
dhruv0206 commentedon Sep 16, 2025
Is it still open?
Aqueuse commentedon Sep 25, 2025
@OmkarBansod02 seemed to have worked a lot on this one. Can you tell us what is missing on his proposition so that we can iterate on them instead of redoing all from scratch ?
sanskarprasad commentedon Oct 3, 2025
still up for grabs??
would love to contribute here!
maniya81 commentedon Oct 12, 2025
Is it still open, if open I would love to contribute
fix(supabase): handle multiple filters in liveProvider