Skip to content

Conversation

@KajalMathe
Copy link

Issue:
Supabase Realtime currently supports only one filter per subscription. When multiple filters were provided, the live provider would send an invalid payload, causing the subscription to fail.

Fix:

Updated liveProvider in packages/supabase/src/liveProvider/index.ts.

Added mapFilter function to handle multiple filters by using only the first filter.

Added a console warning to inform users when multiple filters are provided.

Ensures that the filter parameter in Supabase Realtime is valid, preventing subscription errors.

Changes in this PR:

mapFilter function added to safely map filters.

Subscriptions now correctly apply only the first filter.

Console warning added for clarity.

All other functionality of liveProvider remains intact.

Example:

// Before: multiple filters would break subscription
subscribe({
channel: "resources/posts",
types: ["created", "updated"],
params: {
filters: [
{ field: "status", operator: "eq", value: "active" },
{ field: "category", operator: "eq", value: "tech" },
],
},
callback: () => {},
});

// After: only first filter is applied, subscription works

Testing:

Manual testing on local Supabase project confirmed that multiple filters no longer break the subscription.

Verified that single filters still work as expected.

Checked console warning appears when more than one filter is passed.

Related Issue:

(If the repo has an issue number, add it here, e.g., Fixes #1234)

Impact:

Improves stability for users subscribing with filters in Supabase Realtime.

Avoids runtime errors due to unsupported multiple filters.

@KajalMathe KajalMathe requested a review from a team as a code owner January 10, 2026 15:01
@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2026

⚠️ No Changeset found

Latest commit: 5358e08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@BatuhanW BatuhanW changed the title Fix Supabase Realtime subscription to handle only the first filter Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant