Skip to content

fix(auth): port main's changes to v3 - #1795

Merged
spydon merged 13 commits into
v3from
v3-sync/05-auth
Oct 27, 2026
Merged

spydon merged 13 commits into
v3from
v3-sync/05-auth

Conversation

@spydon

@spydon spydon commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-picks main's auth commits onto v3, ported to v3's client.py, session.py, errors.py and helpers.py. Where v3 already had the behavior (899302e, 553cb47), only the tests are ported, and the commit message says so.

Review fixes

  • exchange_code_for_session(auth_code, *, code_verifier=None, redirect_to=None): without a verifier it reads the one stored by the flow and removes it afterwards, and it saves the session and emits SIGNED_IN, as on main. The keyword-only arguments make old positional calls fail instead of swapping the verifier and the code.
  • An autoconfirmed sign-up removes its unused verifier.
  • Unsubscribing twice no longer raises.
  • Every flow stores its verifier through one helper.
  • A listener that raises is logged instead of aborting the other listeners or making initialize() drop a session it just refreshed.
  • sign_in_with_sso() clears the current session first, as on main.
  • The stored verifier is removed on sign-out and after a failed exchange.

Commits

Stack

This replaces #1789: main's changes since 6f522d3 are cherry-picked onto v3 one package at a time, so each part can be reviewed on its own. Merge from the bottom up.

  1. chore: sync CI, dependency and tooling changes from main #1791
  2. fix: v3 fixes found while syncing main #1792
  3. fix(supabase): sync client options fix from main and make storage list_v2 folder keys optional #1793
  4. fix(functions): port main's changes to v3 #1794
  5. fix(auth): port main's changes to v3 #1795 (this PR)
  6. fix(postgrest): port main's changes to v3 #1796
  7. fix(storage): port main's changes to v3 #1797
  8. fix(realtime): port main's changes to v3 #1798
  9. chore: sync sdk-compliance.yaml with the v3 public API #1790

Comment thread src/auth/src/supabase_auth/client.py Resolved
Comment thread src/auth/src/supabase_auth/client.py Resolved
Comment thread src/auth/src/supabase_auth/client.py Resolved
Comment thread src/auth/src/supabase_auth/session.py Resolved
Comment thread src/auth/src/supabase_auth/client.py Resolved
Comment thread src/auth/src/supabase_auth/client.py Resolved
Comment thread src/auth/src/supabase_auth/client.py Resolved
@spydon
spydon force-pushed the v3-sync/05-auth branch 2 times, most recently from 3f1356f to 860362f Compare October 26, 2026 13:45
@spydon
spydon removed this pull request from stack #1799 October 26, 2026 15:40
@spydon
spydon added this pull request to stack #1841 October 26, 2026 15:40
@spydon
spydon removed this pull request from stack #1841 October 26, 2026 15:42
@spydon
spydon added this pull request to stack #1842 October 26, 2026 15:42
@spydon
spydon force-pushed the v3-sync/05-auth branch 2 times, most recently from a1be85b to abcd9e5 Compare October 27, 2026 16:55
Base automatically changed from v3-sync/04-functions to v3 October 27, 2026 17:10
…1603)

v3 already typed validate_exp as accepting None, so only the tests are ported.

(cherry picked from commit 899302e)
hsusul and others added 11 commits October 27, 2026 18:13
v3 already builds an immutable URLQuery from query_params without mutating it, so only the tests are ported.

(cherry picked from commit 553cb47)
exchange_code_for_session() now takes the auth code first, with code_verifier and redirect_to as keyword-only arguments. Without a verifier it reads the one stored by the flow, removes it after the exchange, saves the session and emits SIGNED_IN, as on main. An autoconfirmed sign-up removes its unused verifier, unsubscribing twice no longer raises, and every flow stores its verifier through one helper.
A listener that raises is logged instead of aborting the other listeners, and it no longer makes initialize() drop a session it just refreshed. sign_in_with_sso() clears the current session first, as on main. The stored verifier is removed on sign-out and after a failed exchange, so it cannot leak into a later one.
v3 builds every URL with yarl's joinpath, which already ignores a trailing slash on the base URL, so only the tests are ported.

(cherry picked from commit de040ec)
Ported to v3's shared _set_session: when the returned session still has the given access token, it was not refreshed, so set_session emits SIGNED_IN.

(cherry picked from commit 9c092db)
…hared base

sign_in_with_sso, reset_password_for_email and exchange_code_for_session are now defined on AsyncSupabaseAuthClient and SyncSupabaseAuthClient to handle the PKCE verifier, so they are public symbols of those classes.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Capability matrix drift detected

The following capabilities are marked implemented in the matrix but could not be found in python:

  • auth.sign_in.sign_up → expected symbol: AsyncGoTrueClient.sign_up
  • auth.sign_in.sign_up → expected symbol: SyncGoTrueClient.sign_up
  • auth.sign_in.sign_in_with_password → expected symbol: AsyncGoTrueClient.sign_in_with_password
  • auth.sign_in.sign_in_with_password → expected symbol: SyncGoTrueClient.sign_in_with_password
  • auth.sign_in.sign_in_with_oauth → expected symbol: AsyncGoTrueClient.sign_in_with_oauth
  • auth.sign_in.sign_in_with_oauth → expected symbol: SyncGoTrueClient.sign_in_with_oauth
  • auth.sign_in.sign_in_with_otp → expected symbol: AsyncGoTrueClient.sign_in_with_otp
  • auth.sign_in.sign_in_with_otp → expected symbol: SyncGoTrueClient.sign_in_with_otp
  • auth.sign_in.sign_in_with_id_token → expected symbol: AsyncGoTrueClient.sign_in_with_id_token
  • auth.sign_in.sign_in_with_id_token → expected symbol: SyncGoTrueClient.sign_in_with_id_token
  • auth.sign_in.sign_in_anonymously → expected symbol: AsyncGoTrueClient.sign_in_anonymously
  • auth.sign_in.sign_in_anonymously → expected symbol: SyncGoTrueClient.sign_in_anonymously
  • auth.sign_in.verify_otp → expected symbol: AsyncGoTrueClient.verify_otp
  • auth.sign_in.verify_otp → expected symbol: SyncGoTrueClient.verify_otp
  • auth.sign_in.resend_confirmation → expected symbol: AsyncGoTrueClient.resend
  • auth.sign_in.resend_confirmation → expected symbol: SyncGoTrueClient.resend
  • auth.sign_in.reauthenticate → expected symbol: AsyncGoTrueClient.reauthenticate
  • auth.sign_in.reauthenticate → expected symbol: SyncGoTrueClient.reauthenticate
  • auth.session.get_session → expected symbol: AsyncGoTrueClient.get_session
  • auth.session.get_session → expected symbol: SyncGoTrueClient.get_session
  • auth.session.get_user → expected symbol: AsyncGoTrueClient.get_user
  • auth.session.get_user → expected symbol: SyncGoTrueClient.get_user
  • auth.session.get_claims → expected symbol: AsyncGoTrueClient.get_claims
  • auth.session.get_claims → expected symbol: SyncGoTrueClient.get_claims
  • auth.session.refresh_session → expected symbol: AsyncGoTrueClient.refresh_session
  • auth.session.refresh_session → expected symbol: SyncGoTrueClient.refresh_session
  • auth.session.set_session → expected symbol: AsyncGoTrueClient.set_session
  • auth.session.set_session → expected symbol: SyncGoTrueClient.set_session
  • auth.session.sign_out → expected symbol: AsyncGoTrueClient.sign_out
  • auth.session.sign_out → expected symbol: SyncGoTrueClient.sign_out
  • auth.session.update_user → expected symbol: AsyncGoTrueClient.update_user
  • auth.session.update_user → expected symbol: SyncGoTrueClient.update_user
  • auth.session.subscribe_auth_events → expected symbol: AsyncGoTrueClient.on_auth_state_change
  • auth.session.subscribe_auth_events → expected symbol: SyncGoTrueClient.on_auth_state_change
  • auth.identities.link_identity → expected symbol: AsyncGoTrueClient.link_identity
  • auth.identities.link_identity → expected symbol: SyncGoTrueClient.link_identity
  • auth.identities.unlink_identity → expected symbol: AsyncGoTrueClient.unlink_identity
  • auth.identities.unlink_identity → expected symbol: SyncGoTrueClient.unlink_identity
  • auth.identities.list_identities → expected symbol: AsyncGoTrueClient.get_user_identities
  • auth.identities.list_identities → expected symbol: SyncGoTrueClient.get_user_identities
  • auth.mfa.enroll → expected symbol: AsyncGoTrueMFAAPI.enroll
  • auth.mfa.enroll → expected symbol: SyncGoTrueMFAAPI.enroll
  • auth.mfa.challenge → expected symbol: AsyncGoTrueMFAAPI.challenge
  • auth.mfa.challenge → expected symbol: SyncGoTrueMFAAPI.challenge
  • auth.mfa.verify → expected symbol: AsyncGoTrueMFAAPI.verify
  • auth.mfa.verify → expected symbol: SyncGoTrueMFAAPI.verify
  • auth.mfa.unenroll → expected symbol: AsyncGoTrueMFAAPI.unenroll
  • auth.mfa.unenroll → expected symbol: SyncGoTrueMFAAPI.unenroll
  • auth.mfa.challenge_and_verify → expected symbol: AsyncGoTrueMFAAPI.challenge_and_verify
  • auth.mfa.challenge_and_verify → expected symbol: SyncGoTrueMFAAPI.challenge_and_verify
  • auth.mfa.list_factors → expected symbol: AsyncGoTrueMFAAPI.list_factors
  • auth.mfa.list_factors → expected symbol: SyncGoTrueMFAAPI.list_factors
  • auth.mfa.get_authenticator_assurance_level → expected symbol: AsyncGoTrueMFAAPI.get_authenticator_assurance_level
  • auth.mfa.get_authenticator_assurance_level → expected symbol: SyncGoTrueMFAAPI.get_authenticator_assurance_level
  • auth.admin.create_user → expected symbol: AsyncGoTrueAdminAPI.create_user
  • auth.admin.create_user → expected symbol: SyncGoTrueAdminAPI.create_user
  • auth.admin.delete_user → expected symbol: AsyncGoTrueAdminAPI.delete_user
  • auth.admin.delete_user → expected symbol: SyncGoTrueAdminAPI.delete_user
  • auth.admin.update_user → expected symbol: AsyncGoTrueAdminAPI.update_user_by_id
  • auth.admin.update_user → expected symbol: SyncGoTrueAdminAPI.update_user_by_id
  • auth.admin.get_user → expected symbol: AsyncGoTrueAdminAPI.get_user_by_id
  • auth.admin.get_user → expected symbol: SyncGoTrueAdminAPI.get_user_by_id
  • auth.admin.list_users → expected symbol: AsyncGoTrueAdminAPI.list_users
  • auth.admin.list_users → expected symbol: SyncGoTrueAdminAPI.list_users
  • auth.admin.invite_user → expected symbol: AsyncGoTrueAdminAPI.invite_user_by_email
  • auth.admin.invite_user → expected symbol: SyncGoTrueAdminAPI.invite_user_by_email
  • auth.admin.sign_out → expected symbol: AsyncGoTrueAdminAPI.sign_out
  • auth.admin.sign_out → expected symbol: SyncGoTrueAdminAPI.sign_out
  • auth.admin.generate_link → expected symbol: AsyncGoTrueAdminAPI.generate_link
  • auth.admin.generate_link → expected symbol: SyncGoTrueAdminAPI.generate_link
  • auth.admin.list_mfa_factors → expected symbol: AsyncGoTrueAdminMFAAPI.list_factors
  • auth.admin.list_mfa_factors → expected symbol: SyncGoTrueAdminMFAAPI.list_factors
  • auth.admin.delete_mfa_factor → expected symbol: AsyncGoTrueAdminMFAAPI.delete_factor
  • auth.admin.delete_mfa_factor → expected symbol: SyncGoTrueAdminMFAAPI.delete_factor
  • auth.oauth_admin.create_client → expected symbol: AsyncGoTrueAdminOAuthAPI.create_client
  • auth.oauth_admin.create_client → expected symbol: SyncGoTrueAdminOAuthAPI.create_client
  • auth.oauth_admin.delete_client → expected symbol: AsyncGoTrueAdminOAuthAPI.delete_client
  • auth.oauth_admin.delete_client → expected symbol: SyncGoTrueAdminOAuthAPI.delete_client
  • auth.oauth_admin.get_client → expected symbol: AsyncGoTrueAdminOAuthAPI.get_client
  • auth.oauth_admin.get_client → expected symbol: SyncGoTrueAdminOAuthAPI.get_client
  • auth.oauth_admin.list_clients → expected symbol: AsyncGoTrueAdminOAuthAPI.list_clients
  • auth.oauth_admin.list_clients → expected symbol: SyncGoTrueAdminOAuthAPI.list_clients
  • auth.oauth_admin.regenerate_client_secret → expected symbol: AsyncGoTrueAdminOAuthAPI.regenerate_client_secret
  • auth.oauth_admin.regenerate_client_secret → expected symbol: SyncGoTrueAdminOAuthAPI.regenerate_client_secret
  • auth.oauth_admin.update_client → expected symbol: AsyncGoTrueAdminOAuthAPI.update_client
  • auth.oauth_admin.update_client → expected symbol: SyncGoTrueAdminOAuthAPI.update_client
  • database.query.from_table → expected symbol: AsyncPostgrestClient.from_
  • database.query.from_table → expected symbol: AsyncPostgrestClient.table
  • database.query.from_table → expected symbol: SyncPostgrestClient.from_
  • database.query.from_table → expected symbol: SyncPostgrestClient.table
  • database.query.select → expected symbol: AsyncRequestBuilder.select
  • database.query.select → expected symbol: SyncRequestBuilder.select
  • database.query.rpc → expected symbol: AsyncPostgrestClient.rpc
  • database.query.rpc → expected symbol: SyncPostgrestClient.rpc
  • database.mutate.insert → expected symbol: AsyncRequestBuilder.insert
  • database.mutate.insert → expected symbol: SyncRequestBuilder.insert
  • database.mutate.update → expected symbol: AsyncRequestBuilder.update
  • database.mutate.update → expected symbol: SyncRequestBuilder.update
  • database.mutate.upsert → expected symbol: AsyncRequestBuilder.upsert
  • database.mutate.upsert → expected symbol: SyncRequestBuilder.upsert
  • database.mutate.delete → expected symbol: AsyncRequestBuilder.delete
  • database.mutate.delete → expected symbol: SyncRequestBuilder.delete
  • database.using_modifiers.single_row → expected symbol: AsyncSelectRequestBuilder.single
  • database.using_modifiers.single_row → expected symbol: SyncSelectRequestBuilder.single
  • database.using_modifiers.maybe_single_row → expected symbol: AsyncSelectRequestBuilder.maybe_single
  • database.using_modifiers.maybe_single_row → expected symbol: SyncSelectRequestBuilder.maybe_single
  • database.using_modifiers.format_csv → expected symbol: AsyncSelectRequestBuilder.csv
  • database.using_modifiers.format_csv → expected symbol: SyncSelectRequestBuilder.csv
  • database.using_modifiers.explain → expected symbol: AsyncSelectRequestBuilder.explain
  • database.using_modifiers.explain → expected symbol: SyncSelectRequestBuilder.explain
  • database.configuration.auto_retry → expected symbol: AsyncSelectRequestBuilder.retry
  • database.configuration.auto_retry → expected symbol: SyncSelectRequestBuilder.retry
  • functions.invocation.invoke → expected symbol: AsyncFunctionsClient.invoke
  • functions.invocation.invoke → expected symbol: SyncFunctionsClient.invoke
  • functions.invocation.set_auth_token → expected symbol: AsyncFunctionsClient.set_auth
  • functions.invocation.set_auth_token → expected symbol: SyncFunctionsClient.set_auth
  • realtime.client.connect → expected symbol: AsyncRealtimeClient.connect
  • realtime.client.connect → expected symbol: SyncRealtimeClient.connect
  • realtime.client.disconnect → expected symbol: AsyncRealtimeClient.disconnect
  • realtime.client.disconnect → expected symbol: SyncRealtimeClient.disconnect
  • realtime.client.get_channels → expected symbol: AsyncRealtimeClient.get_channels
  • realtime.client.get_channels → expected symbol: SyncRealtimeClient.get_channels
  • realtime.client.remove_channel → expected symbol: AsyncRealtimeClient.remove_channel
  • realtime.client.remove_channel → expected symbol: SyncRealtimeClient.remove_channel
  • realtime.client.remove_all_channels → expected symbol: AsyncRealtimeClient.remove_all_channels
  • realtime.client.remove_all_channels → expected symbol: SyncRealtimeClient.remove_all_channels
  • realtime.client.set_auth_token → expected symbol: AsyncRealtimeClient.set_auth
  • realtime.client.set_auth_token → expected symbol: SyncRealtimeClient.set_auth
  • realtime.client.channel → expected symbol: AsyncRealtimeClient.channel
  • realtime.client.channel → expected symbol: SyncRealtimeClient.channel
  • realtime.channel.subscribe → expected symbol: AsyncRealtimeChannel.subscribe
  • realtime.channel.subscribe → expected symbol: SyncRealtimeChannel.subscribe
  • realtime.channel.unsubscribe → expected symbol: AsyncRealtimeChannel.unsubscribe
  • realtime.channel.unsubscribe → expected symbol: SyncRealtimeChannel.unsubscribe
  • realtime.channel.broadcast → expected symbol: AsyncRealtimeChannel.send_broadcast
  • realtime.channel.broadcast → expected symbol: SyncRealtimeChannel.send_broadcast
  • realtime.subscriptions.broadcast → expected symbol: AsyncRealtimeChannel.on_broadcast
  • realtime.subscriptions.broadcast → expected symbol: SyncRealtimeChannel.on_broadcast
  • realtime.subscriptions.postgres_changes → expected symbol: AsyncRealtimeChannel.on_postgres_changes
  • realtime.subscriptions.postgres_changes → expected symbol: SyncRealtimeChannel.on_postgres_changes
  • realtime.subscriptions.subscribe_presence → expected symbol: AsyncRealtimeChannel.on_presence_change
  • realtime.subscriptions.subscribe_presence → expected symbol: SyncRealtimeChannel.on_presence_change
  • realtime.presence.track → expected symbol: AsyncRealtimeChannel.track
  • realtime.presence.track → expected symbol: SyncRealtimeChannel.track
  • realtime.presence.untrack → expected symbol: AsyncRealtimeChannel.untrack
  • realtime.presence.untrack → expected symbol: SyncRealtimeChannel.untrack
  • realtime.presence.presence_state → expected symbol: AsyncRealtimeChannel.presences
  • realtime.presence.presence_state → expected symbol: SyncRealtimeChannel.presences
  • storage.file_buckets.create_file_bucket → expected symbol: AsyncStorageBucketAPI.create_bucket
  • storage.file_buckets.create_file_bucket → expected symbol: SyncStorageBucketAPI.create_bucket
  • storage.file_buckets.get_bucket → expected symbol: AsyncStorageBucketAPI.get_bucket
  • storage.file_buckets.get_bucket → expected symbol: SyncStorageBucketAPI.get_bucket
  • storage.file_buckets.list_file_buckets → expected symbol: AsyncStorageBucketAPI.list_buckets
  • storage.file_buckets.list_file_buckets → expected symbol: SyncStorageBucketAPI.list_buckets
  • storage.file_buckets.update_bucket → expected symbol: AsyncStorageBucketAPI.update_bucket
  • storage.file_buckets.update_bucket → expected symbol: SyncStorageBucketAPI.update_bucket
  • storage.file_buckets.delete_file_bucket → expected symbol: AsyncStorageBucketAPI.delete_bucket
  • storage.file_buckets.delete_file_bucket → expected symbol: SyncStorageBucketAPI.delete_bucket
  • storage.file_buckets.empty_bucket → expected symbol: AsyncStorageBucketAPI.empty_bucket
  • storage.file_buckets.empty_bucket → expected symbol: SyncStorageBucketAPI.empty_bucket
  • storage.file_buckets.upload → expected symbol: AsyncBucketActionsMixin.upload
  • storage.file_buckets.upload → expected symbol: SyncBucketActionsMixin.upload
  • storage.file_buckets.download → expected symbol: AsyncBucketActionsMixin.download
  • storage.file_buckets.download → expected symbol: SyncBucketActionsMixin.download
  • storage.file_buckets.list_files → expected symbol: AsyncBucketActionsMixin.list
  • storage.file_buckets.list_files → expected symbol: SyncBucketActionsMixin.list
  • storage.file_buckets.list_files → expected symbol: AsyncBucketActionsMixin.list_v2
  • storage.file_buckets.list_files → expected symbol: SyncBucketActionsMixin.list_v2
  • storage.file_buckets.move → expected symbol: AsyncBucketActionsMixin.move
  • storage.file_buckets.move → expected symbol: SyncBucketActionsMixin.move
  • storage.file_buckets.copy → expected symbol: AsyncBucketActionsMixin.copy
  • storage.file_buckets.copy → expected symbol: SyncBucketActionsMixin.copy
  • storage.file_buckets.remove → expected symbol: AsyncBucketActionsMixin.remove
  • storage.file_buckets.remove → expected symbol: SyncBucketActionsMixin.remove
  • storage.file_buckets.get_public_url → expected symbol: AsyncBucketActionsMixin.get_public_url
  • storage.file_buckets.get_public_url → expected symbol: SyncBucketActionsMixin.get_public_url
  • storage.file_buckets.create_signed_url → expected symbol: AsyncBucketActionsMixin.create_signed_url
  • storage.file_buckets.create_signed_url → expected symbol: SyncBucketActionsMixin.create_signed_url
  • storage.file_buckets.create_signed_urls → expected symbol: AsyncBucketActionsMixin.create_signed_urls
  • storage.file_buckets.create_signed_urls → expected symbol: SyncBucketActionsMixin.create_signed_urls
  • storage.file_buckets.create_signed_upload_url → expected symbol: AsyncBucketActionsMixin.create_signed_upload_url
  • storage.file_buckets.create_signed_upload_url → expected symbol: SyncBucketActionsMixin.create_signed_upload_url
  • storage.file_buckets.upload_with_signed_url → expected symbol: AsyncBucketActionsMixin.upload_to_signed_url
  • storage.file_buckets.upload_with_signed_url → expected symbol: SyncBucketActionsMixin.upload_to_signed_url
  • storage.file_buckets.update_file → expected symbol: AsyncBucketActionsMixin.update
  • storage.file_buckets.update_file → expected symbol: SyncBucketActionsMixin.update
  • storage.file_buckets.file_exists → expected symbol: AsyncBucketActionsMixin.exists
  • storage.file_buckets.file_exists → expected symbol: SyncBucketActionsMixin.exists
  • storage.file_buckets.file_info → expected symbol: AsyncBucketActionsMixin.info
  • storage.file_buckets.file_info → expected symbol: SyncBucketActionsMixin.info
  • storage.file_buckets.download_with_transform → expected symbol: AsyncBucketActionsMixin.create_signed_url
  • storage.file_buckets.download_with_transform → expected symbol: SyncBucketActionsMixin.create_signed_url
  • storage.file_buckets.upload_with_metadata → expected symbol: AsyncBucketActionsMixin.upload
  • storage.file_buckets.upload_with_metadata → expected symbol: SyncBucketActionsMixin.upload
  • storage.file_buckets.url_cache_nonce → expected symbol: AsyncBucketActionsMixin.download
  • storage.file_buckets.url_cache_nonce → expected symbol: SyncBucketActionsMixin.download
  • storage.vector_buckets.create_vector_bucket → expected symbol: AsyncStorageVectorsClient.create_bucket
  • storage.vector_buckets.create_vector_bucket → expected symbol: SyncStorageVectorsClient.create_bucket
  • storage.vector_buckets.list_vector_buckets → expected symbol: AsyncStorageVectorsClient.list_buckets
  • storage.vector_buckets.list_vector_buckets → expected symbol: SyncStorageVectorsClient.list_buckets
  • storage.vector_buckets.delete_vector_bucket → expected symbol: AsyncStorageVectorsClient.delete_bucket
  • storage.vector_buckets.delete_vector_bucket → expected symbol: SyncStorageVectorsClient.delete_bucket
  • storage.vector_buckets.access_vector_index → expected symbol: AsyncStorageClient.vectors
  • storage.vector_buckets.access_vector_index → expected symbol: AsyncStorageVectorsClient.from_
  • storage.vector_buckets.access_vector_index → expected symbol: AsyncVectorBucketScope.index
  • storage.vector_buckets.access_vector_index → expected symbol: SyncStorageClient.vectors
  • storage.vector_buckets.access_vector_index → expected symbol: SyncStorageVectorsClient.from_
  • storage.vector_buckets.access_vector_index → expected symbol: SyncVectorBucketScope.index
  • storage.vector_buckets.create_index → expected symbol: AsyncVectorBucketScope.create_index
  • storage.vector_buckets.create_index → expected symbol: SyncVectorBucketScope.create_index
  • storage.vector_buckets.delete_index → expected symbol: AsyncVectorBucketScope.delete_index
  • storage.vector_buckets.delete_index → expected symbol: SyncVectorBucketScope.delete_index
  • storage.vector_buckets.get_index → expected symbol: AsyncVectorBucketScope.get_index
  • storage.vector_buckets.get_index → expected symbol: SyncVectorBucketScope.get_index
  • storage.vector_buckets.list_indexes → expected symbol: AsyncVectorBucketScope.list_indexes
  • storage.vector_buckets.list_indexes → expected symbol: SyncVectorBucketScope.list_indexes
  • storage.vector_buckets.put_vectors → expected symbol: AsyncVectorIndexScope.put
  • storage.vector_buckets.put_vectors → expected symbol: SyncVectorIndexScope.put
  • storage.vector_buckets.get_vectors → expected symbol: AsyncVectorIndexScope.get
  • storage.vector_buckets.get_vectors → expected symbol: SyncVectorIndexScope.get
  • storage.vector_buckets.delete_vectors → expected symbol: AsyncVectorIndexScope.delete
  • storage.vector_buckets.delete_vectors → expected symbol: SyncVectorIndexScope.delete
  • storage.vector_buckets.list_vectors → expected symbol: AsyncVectorIndexScope.list
  • storage.vector_buckets.list_vectors → expected symbol: SyncVectorIndexScope.list
  • storage.vector_buckets.query_vectors → expected symbol: AsyncVectorIndexScope.query
  • storage.vector_buckets.query_vectors → expected symbol: SyncVectorIndexScope.query
  • storage.vector_buckets.parallel_scan → expected symbol: AsyncVectorIndexScope.list
  • storage.vector_buckets.parallel_scan → expected symbol: SyncVectorIndexScope.list
  • storage.analytics.create_analytics_bucket → expected symbol: AsyncStorageAnalyticsClient.create
  • storage.analytics.create_analytics_bucket → expected symbol: SyncStorageAnalyticsClient.create
  • storage.analytics.list_analytics_buckets → expected symbol: AsyncStorageAnalyticsClient.list
  • storage.analytics.list_analytics_buckets → expected symbol: SyncStorageAnalyticsClient.list
  • storage.analytics.delete_analytics_bucket → expected symbol: AsyncStorageAnalyticsClient.delete
  • storage.analytics.delete_analytics_bucket → expected symbol: SyncStorageAnalyticsClient.delete
  • storage.analytics.access_catalog → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.access_catalog → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.create_namespace → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.create_namespace → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.list_namespaces → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.list_namespaces → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.delete_namespace → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.delete_namespace → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.load_namespace_metadata → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.load_namespace_metadata → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.namespace_exists → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.namespace_exists → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.update_namespace_properties → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.update_namespace_properties → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.create_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.create_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.list_tables → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.list_tables → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.load_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.load_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.update_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.update_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.rename_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.rename_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.delete_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.delete_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.register_table → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.register_table → expected symbol: SyncStorageAnalyticsClient.catalog
  • storage.analytics.table_exists → expected symbol: AsyncStorageAnalyticsClient.catalog
  • storage.analytics.table_exists → expected symbol: SyncStorageAnalyticsClient.catalog

The following capabilities are marked implemented in python but have no registered symbols to verify:

  • auth.session.auto_refresh (no symbols list — cannot confirm implementation exists)
  • client.authentication_integration.cross_client_token_sync (no symbols list — cannot confirm implementation exists)
  • client.authentication_integration.oauth_flow_type (no symbols list — cannot confirm implementation exists)
  • client.session_management.custom_storage (no symbols list — cannot confirm implementation exists)
  • client.session_management.persist_session (no symbols list — cannot confirm implementation exists)
  • client.request_configuration.custom_http_client (no symbols list — cannot confirm implementation exists)
  • client.request_configuration.global_headers (no symbols list — cannot confirm implementation exists)
  • database.mutate.select_after_mutation (no symbols list — cannot confirm implementation exists)
  • database.mutate.bulk_rows_with_differing_fields (no symbols list — cannot confirm implementation exists)
  • database.mutate.count (no symbols list — cannot confirm implementation exists)
  • database.mutate.missing_defaults (no symbols list — cannot confirm implementation exists)
  • database.using_filters.eq (no symbols list — cannot confirm implementation exists)
  • database.using_filters.neq (no symbols list — cannot confirm implementation exists)
  • database.using_filters.gt (no symbols list — cannot confirm implementation exists)
  • database.using_filters.gte (no symbols list — cannot confirm implementation exists)
  • database.using_filters.lt (no symbols list — cannot confirm implementation exists)
  • database.using_filters.lte (no symbols list — cannot confirm implementation exists)
  • database.using_filters.like (no symbols list — cannot confirm implementation exists)
  • database.using_filters.ilike (no symbols list — cannot confirm implementation exists)
  • database.using_filters.is (no symbols list — cannot confirm implementation exists)
  • database.using_filters.in (no symbols list — cannot confirm implementation exists)
  • database.using_filters.contains (no symbols list — cannot confirm implementation exists)
  • database.using_filters.contained_by (no symbols list — cannot confirm implementation exists)
  • database.using_filters.range_gt (no symbols list — cannot confirm implementation exists)
  • database.using_filters.range_gte (no symbols list — cannot confirm implementation exists)
  • database.using_filters.range_lt (no symbols list — cannot confirm implementation exists)
  • database.using_filters.range_lte (no symbols list — cannot confirm implementation exists)
  • database.using_filters.range_adjacent (no symbols list — cannot confirm implementation exists)
  • database.using_filters.overlaps (no symbols list — cannot confirm implementation exists)
  • database.using_filters.text_search (no symbols list — cannot confirm implementation exists)
  • database.using_filters.match (no symbols list — cannot confirm implementation exists)
  • database.using_filters.not (no symbols list — cannot confirm implementation exists)
  • database.using_filters.or (no symbols list — cannot confirm implementation exists)
  • database.using_filters.raw (no symbols list — cannot confirm implementation exists)
  • database.using_filters.regex (no symbols list — cannot confirm implementation exists)
  • database.using_filters.regex_icase (no symbols list — cannot confirm implementation exists)
  • database.using_filters.not_in (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.order (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.limit (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.range (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.request_cancellation (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.relationship_embed (no symbols list — cannot confirm implementation exists)
  • database.configuration.request_timeout (no symbols list — cannot confirm implementation exists)
  • functions.invocation.method_override (no symbols list — cannot confirm implementation exists)
  • functions.invocation.region_selection (no symbols list — cannot confirm implementation exists)
  • functions.invocation.request_cancellation (no symbols list — cannot confirm implementation exists)
  • functions.invocation.timeout (no symbols list — cannot confirm implementation exists)
  • realtime.subscriptions.postgres_changes_filter (no symbols list — cannot confirm implementation exists)
  • realtime.subscriptions.private_channel (no symbols list — cannot confirm implementation exists)
  • realtime.subscriptions.broadcast_self (no symbols list — cannot confirm implementation exists)
  • realtime.subscriptions.broadcast_replay (no symbols list — cannot confirm implementation exists)
  • realtime.subscriptions.postgres_changes_multiple_filters (no symbols list — cannot confirm implementation exists)
  • realtime.presence.presence_key (no symbols list — cannot confirm implementation exists)
  • realtime.configuration.heartbeat_interval (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.access_bucket (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.request_cancellation (no symbols list — cannot confirm implementation exists)

These may have been renamed, removed, or never registered. Please update the capability matrix.
See: https://github.com/supabase/sdk/blob/main/packages/capability-matrix/docs/capability-matrix.md

@spydon
spydon merged commit 0413cff into v3 Oct 27, 2026
36 checks passed
@spydon
spydon deleted the v3-sync/05-auth branch October 27, 2026 19:45
spydon added a commit that referenced this pull request Nov 16, 2026
Step 4 of [SDK-2765](https://linear.app/supabase/issue/SDK-2765)
([SDK-2987](https://linear.app/supabase/issue/SDK-2987)): the typed
query builder over the table definition, the request value and the
executors of #2043. A port of the typed builders of supabase-flutter
#1795, as they are today on top of `PostgrestTableRequest`.

```python
books = (
    client.table(Books.table)
    .select()
    .where((Books.pages.gt(300) | Books.isbn.is_null()) & ~Books.id.eq(1))
    .order(Books.title.desc().nulls_last())
    .limit(10)
    .execute()
)
# books: list[BooksRow]
```

## What

- `PostgrestClient.table(Books.table)` returns
`TypedQueryBuilder[Executor, Row, Insert, Update]` through an overload
on the type of the client: `TableExecutor` on `SyncPostgrestClient` and
`AsyncTableExecutor` on `AsyncPostgrestClient`, over the HTTP executor
of that client. `table("books")` keeps returning the string builder.
- The builders collect a `TableRequest` without rendering anything.
`execute()` hands it to the executor and converts the `TableResult`: it
returns `T` on the sync client and an awaitable of `T` on the async one,
through overloads on `self` as `handle_http_io` does, with the runtime
branch decided by what the executor returns. Every method returns a
copy.
- `TypedQueryBuilder`: `select()` resolves to `list[Row]` through a
cached `TypeAdapter(list[Row])`, `select_only([...])` to
`list[PartialRow[Row]]`; `insert`, `upsert(on_conflict=,
ignore_duplicates=)`, `update`, `delete` and `count()`.
- `TypedFilterBuilder.where(filter)`, combining repeated calls with `&`.
`TypedTransformBuilder`: `select`, `select_only`, `order` (appends),
`limit`, `range`, `strip_nulls`, `dry_run`, `max_affected`, `csv`
(`str`), `head` (`None`), `geojson` (`dict[str, JSON]`), `explain`
(`str`, or `JSON` with `format="json"`), `count` (`CountedResponse[T]`),
and `single` (`Row`) and `maybe_single` (`Row | None`), which an
explicit `self` type offers on a builder that resolves to a list only,
so a write needs `select()` first. `retry()` and `request_timeout()` on
every builder.
- `TypedMutationBuilder`, what `update()` and `delete()` return: no
`execute()` until `where()` or `all()`. A mutation resolves to `None`
unless `select()` or `select_only()` asks the rows back, the one default
that differs from the string builder. `TypedCountBuilder`, what
`count()` on the table returns: `where()` only, resolving to `int`.
- Writes take `Insert | Iterable[Insert]` and `Update`. A view's
`Table[Row, Never, Never]` makes `insert`, `upsert` and `update`
uncallable. `delete()` takes no value of the write type, so it is gated
by an overload on `self`: with an `Update` of `Never` the checkers see
`None`, so neither `where()` nor `all()` can follow and nothing can be
sent; Dart gates it with an extension and Swift with an unavailable
twin. A payload goes through `pydantic_core.to_jsonable_python`, so
`date` and `UUID` values and pydantic models serialize, and the request
holds the plain JSON that `TableRequest.payload` promises.
- `PartialRow[Row]`: `row[Books.title]` is a `str`, a `NullableColumn`
or `ComputedField` entry reads `Value | None`, and an entry of another
table is a type error, through `__getitem__` overloads. A value decodes
through the field of `Row` the entry is named after, so a `date` column
reads as a `date` as it does from `select()`, and as the decoded JSON
for an ad hoc column. A computed field, which `Row` never carries,
decodes through the new optional `value_type` of `ComputedField`, the
Python form of Dart's `fromJson`, which the generator will give for
every field whose type differs from its JSON form; without it the value
is the decoded JSON, which is right for `str`, `int`, `float`, `bool`
and JSON values. An entry the list did not ask for raises `KeyError`, a
stripped column reads `None`, and `to_row()` decodes the whole row; the
row holds its table, so `to_row()` takes no argument.
- `CountedResponse(data, count)`.

`ValueError` before anything is sent for an empty `select_only`, an
empty `on_conflict`, a `range` whose end comes before its start and
`head()` after a write; `TypeError` for a payload that is neither a row,
a mapping, nor an iterable of rows.

## Tests

- `test_typed_builder.py`: the request each method collects, against
recording executors; the conversion of each shape; write payloads as one
row, a list, a tuple, an iterator and a pydantic model, and the rejected
ones; immutability and equality; sync and async `execute()`; both
clients end to end through `MockTransport`, with `features=typed-api` on
the wire.
- `test_partial_row.py`: reads by column kind, decoding through the row
model, its aliases, the annotations of a dataclass and a row type
without fields, `KeyError`, stripped nulls, `to_row()`, repr and
equality.
- `tests/typecheck/queries.py` under mypy, pyright and pyrefly: the
result type of every method on both clients with `assert_type`, filters
and orderings of another table, `single()` on a mutation, `where()`
after a shape, the `__getitem__` overloads, `Never` write types on a
view including `delete()`, a mutation without `where()` or `all()`
having no `execute()`, and `await` of a sync result.
- Integration tests for every method on both clients,
`tests/_async/test_typed_query_builder_integration.py` and `_sync/`,
against the local stack. A new migration adds a `books` table with
identity ids, a nullable column, an array, a jsonb column, a unique
constraint and a computed field, a `book_titles` view, and a `places`
table with PostGIS for `geojson()`. It sets `pgrst.db_tx_end =
commit-allow-override` for `dry_run()`, and `safeupdate.enabled = false`
on the API role: the stack loads `safeupdate`, which rejects the
unfiltered update and delete that the tests of `all()` send on purpose,
in a dry run; the migration role cannot change
`session_preload_libraries` itself.

## Compliance

The new symbols are listed under the top-level `supporting_symbols` of
`sdk-compliance.yaml`, as in the earlier steps; the feature status
changes in step 8.

Linear: SDK-2987
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.

3 participants