fix: handle multiple filters in Supabase Realtime liveProvider#7259
fix: handle multiple filters in Supabase Realtime liveProvider#7259themavik wants to merge 3 commits into
Conversation
Supabase Realtime only supports a single filter per `.on()` call. When multiple filters were provided, they were joined with commas into an invalid filter string, causing the realtime subscription to fail silently. Now only passes a filter to Supabase when there's exactly one. When multiple filters exist, subscribes without server-side filtering to avoid the invalid payload. Fixes #6360
|
|
Hi @themavik, thanks for the contribution, Instead of returning directly here, I think it would be better to log a warning. An early return might hide the issue and make debugging harder. |
|
Good point - updated the approach. Instead of an early return, I'll add a |
…z feedback) Co-authored-by: Cursor <cursoragent@cursor.com>
…upabase Realtime liveProvider Rebase onto refinedev/main. When multiple filters are provided, return undefined to subscribe to all changes (client-side filtering) instead of using invalid comma-joined syntax. Fixes #6360
|
closed in favor of this PR: #7281 |
Summary
Fixes #6360
Root cause: Supabase Realtime
.on()only supports a single filter per subscription. ThemapFilterfunction joined multiple filters with commas into a single string, which is not valid Supabase Realtime syntax, causing subscriptions to fail.Changes
packages/supabase/src/liveProvider/index.ts: When multiple filters are provided, returnsundefinedinstead of an invalid comma-joined filter string. This makes Supabase subscribe to all changes on the table.Risk Assessment
Low - Single-filter behavior is unchanged. Multi-filter now gracefully degrades to unfiltered subscription instead of failing.