refine icon indicating copy to clipboard operation
refine copied to clipboard

[BUG] Multiple Filters not Supported by Supabase Realtime

Open amerryma opened this issue 1 year ago • 15 comments

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

  1. Create any realtime resource
  2. Add more than 1 filter to the resource (I was using a useList hook with multiple objects in the filters option)
  3. 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.

https://github.com/refinedev/refine/blame/8be95d808ae2f3f280ebd015bd95eb04238fe463/packages/supabase/src/liveProvider/index.ts#L67

See here for feature that is being discussed. No real activity it seems.

https://github.com/supabase/realtime/issues/486 https://github.com/supabase/realtime-js/issues/97

amerryma avatar Sep 19 '24 20:09 amerryma