Skip to content

Conversation

@alexwhitmore
Copy link

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Fixes #1319

postgres_changes subscriptions always time out after 10 seconds and never receive payloads. The client sends events (plural) but the server expects event (singular), causing a protocol mismatch in three places:

  1. binding_filter sends {"events": "*", "table": null} instead of {"event": "*"}
  2. PostgresRowChange model expects events field but server returns event
  3. channel.py compares server_binding.events which doesn't exist

What is the new behavior?

Subscriptions work correctly - state becomes SUBSCRIBED and payloads are received:

[2025-12-18 15:34:44.153631] Channel subscription state: RealtimeSubscribeStates.SUBSCRIBED

[2025-12-18 15:35:05.561223] *** RECEIVED PAYLOAD ***
{'data': {'schema': 'public', 'table': 'test_messages', 'commit_timestamp': '2025-12-18T14:35:05.504Z', 'type': <RealtimePostgresChangesListenEvent.Insert: 'INSERT'>, 'errors': None, 'columns': [{'name': 'id', 'type': 'int4'}, {'name': 'content', 'type': 'text'}, {'name': 'created_at', 'type': 'timestamptz'}], 'record': {'id': 16, 'content': 'testing fix', 'created_at': '2025-12-18T14:35:05.502162+00:00'}}, 'ids': [74307548]}

Additional context

Tested with local Supabase (realtime v2.67.2), Python 3.13.3, supabase-py 1.2.0.

Changes:

  • types.py: binding_filter sends "event" key, only includes "table" if specified
  • message.py: PostgresRowChange.eventsevent, table is now optional
  • channel.py: server_binding.eventsserver_binding.event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watching for postgres changes always times out

1 participant