Conversation
This branch has not been deployed
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
Problem
AsyncRealtimeClientstored its documentedparams, butconnect()openedself.urldirectly. Supported connection parameters such aslog_leveland thevsnprepared byendpoint_url()never reached the Realtime server.Root cause
The URL builder existed but was bypassed by the connection path. It also replaced the URL's existing query string, which would have dropped the API key if used directly.
Solution
Build the endpoint once per connection attempt sequence, preserving existing query parameters before adding configured parameters and
vsn, and pass that URL to the WebSocket transport.Tests
test_connect_includes_connection_paramsfailed on cleanmainbecauselog_levelandvsnwere absentuv run --package realtime pytest -o addopts= tests/test_connection.py::test_connect_includes_connection_params -q— 1 passedmake testsinsrc/realtime— mypy passed and 32 tests passed using the Supabase CLI service containersValidation
uv run ruff check src/realtime— passeduv run ruff format --check src/realtime— 21 files already formatteduv build --package realtime— source distribution and wheel built successfullygit diff --check— passedCompatibility and risk
The public API is unchanged. Existing API-key authentication is preserved; callers that provide connection parameters now get the documented behavior. The sync Realtime client is unchanged because it does not implement connections.
Documentation
No documentation change is needed because this restores the existing
paramscontract.Fixes #1651
cc @olirice @silentworks