fix: handle multiple filters in Supabase Realtime liveProvider#7259
Open
themavik wants to merge 1 commit intorefinedev:mainfrom
Open
fix: handle multiple filters in Supabase Realtime liveProvider#7259themavik wants to merge 1 commit intorefinedev:mainfrom
themavik wants to merge 1 commit intorefinedev:mainfrom
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 refinedev#6360
|
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.