{"record":{"id":"92eddbab321ad67a","repo":"refinedev/refine","slug":"refine-supabase-multiple-filters-are-not-support","errorCode":null,"errorMessage":"[refine/supabase] Multiple filters are not supported for Supabase Realtime subscriptions. Using only the first filter: \"${mapped[0]}\".","messagePattern":"\\[refine/supabase\\] Multiple filters are not supported for Supabase Realtime subscriptions\\. Using only the first filter: \"(.+?)\"\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/supabase/src/liveProvider/index.ts","lineNumber":74,"sourceCode":"\n        const mapped = filters\n          .map((filter: CrudFilter): string | undefined => {\n            if (\"field\" in filter) {\n              return `${filter.field}=${mapOperator(filter.operator)}.${\n                filter.value\n              }`;\n            }\n            return;\n          })\n          .filter((x): x is string => Boolean(x));\n\n        if (mapped.length === 0) return;\n\n        if (mapped.length > 1) {\n          // Supabase Realtime currently supports only a single `filter` string\n          // for postgres_changes. Joining multiple filters with commas\n          // results in an invalid payload and may break the subscription.\n          console.warn(\n            `[refine/supabase] Multiple filters are not supported for Supabase Realtime subscriptions. Using only the first filter: \"${mapped[0]}\".`,\n          );\n        }\n\n        return mapped[0];\n      };\n\n      const events = types\n        .map((x) => supabaseTypes[x])\n        .sort((a, b) => a.localeCompare(b));\n\n      const filter = mapFilter(params?.filters);\n\n      const ch = `${channel}:${events.join(\"|\")}${filter ? `:${filter}` : \"\"}`;\n\n      let client = supabaseClient.channel(ch);\n\n      for (let i = 0; i < events.length; i++) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/supabase/src/liveProvider/index.ts#L56-L92","documentation":"Warned by the Supabase live provider's filter mapper. Supabase Realtime `postgres_changes` subscriptions accept a single filter string per event; when the refine filters map to more than one condition, only the first is applied and the rest are silently dropped (with this warning). The comment notes that comma-joining filters produces an invalid payload and can break the subscription entirely.","triggerScenarios":"Subscribing to a resource via useList/useTable live hooks (liveProvider: supabase) where `filters`/`permanentFilter` produce multiple mapped realtime filters — e.g. filtering on two different columns at once.","commonSituations":"List pages with permanentFilter on one column plus a user-applied filter on another; relying on realtime updates to respect all active table filters.","solutions":["Reduce to a single realtime-relevant filter column, or accept that only the first is used for subscriptions","Move compound filtering client-side: subscribe broadly (single filter) and filter incoming events in `onLiveEvent`/your own logic","Use a database view or a computed column so one filter column captures the condition, and point the resource/filter at it"],"exampleFix":"// before\nconst { data } = useTable({\n  resource: 'orders',\n  filters: { permanent: [\n    { field: 'status', operator: 'eq', value: 'open' },\n    { field: 'storeId', operator: 'eq', value: 5 },\n  ]},\n});\n// after — single filter for realtime; verify remaining conditions client-side\nconst { data } = useTable({\n  resource: 'orders',\n  filters: { permanent: [\n    { field: 'status', operator: 'eq', value: 'open' },\n  ]},\n});","handlingStrategy":"validation","validationCode":"const realtimeFilters = filters.map(mapFilter).filter(Boolean);\nif (realtimeFilters.length > 1) {\n  console.warn('Only the first Supabase realtime filter will be applied');\n}","typeGuard":"const isSingleRealtimeFilter = (mapped: (string | undefined)[]) =>\n  mapped.filter(Boolean).length <= 1;","tryCatchPattern":null,"preventionTips":["Design Supabase-backed list pages around one server-side filter column","Re-verify remaining conditions in onLiveEvent to avoid stale/incorrect live updates"],"tags":["supabase","realtime","live-provider","filters","refine"],"backgroundTag":"realtime-subscription-filter-limit","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}