Repository navigation
feat: add non-obvious capabilities to the matrix - #22
Conversation
QuintinWillison
left a comment
There was a problem hiding this comment.
I've stopped reviewing at about a third down my scroll for now, as I realise that my knowledge of our feature surface is really not deep enough to be able to quickly offer opinion... so, instead, I'm surfacing these thoughts quicker as they're more fundamental in terms of overall structure...
mandarini
left a comment
There was a problem hiding this comment.
There's a structural question I want to ask, because there are several additions. Several capabilities show up in two places, like custom_http_client lives under client.request_config.*, database.config.*, and functions.invocation.*; auto_refresh_token lives in both client.session_management.* and the existing auth.session.auto_refresh; schema_selection collides with database.query.schema_selection; db_timeout shows up at both client.request_config.db_timeout and database.config.request_timeout.
What model are we tracking? Cross-cutting client options live exclusively in client.* and the per-area entries get dropped. Or each sub-client owns its own config and we drop the client.* duplicates. Or both, with the rule that client.* means "configurable at SupabaseClient construction" and <area>.config.* means "configurable on the sub-client directly", and we accept the duplication as a feature (different scopes)?
| name: Session Persistence Toggle | ||
| description: Disable automatic session persistence so the session exists only in memory for the lifetime of the client instance. | ||
| group: session-management | ||
| - id: client.session_management.auto_refresh_token |
There was a problem hiding this comment.
I think this duplicates auth.session.auto_refresh, which already covers exactly this. I collapsed start_auto_refresh and stop_auto_refresh into a single capability. So maybe we could drop this entry.
There was a problem hiding this comment.
Agreed. Dropped from client.* — this belongs in auth. Will note in the auth spec that toggling auto-refresh should be supported.
| name: Global Request Headers | ||
| description: Attach extra HTTP headers to every request made by all sub-clients at construction time. | ||
| group: request-config | ||
| - id: client.request_config.schema_selection |
There was a problem hiding this comment.
Same ID stem as the existing database.query.schema_selection, but different scope (construct-time default vs per-query override). If we keep both, the names need to disambiguate, I think. client.request_config.default_schema I believe reads more clearly. Otherwise we may get confused over which entry an sdk should be declaring against.
There was a problem hiding this comment.
Good point. Keeping a single database.query.schema_selection and dropping the client-level duplicate. The spec for that capability will document that an SDK should support both setting a default schema at construction time and overriding it per query.
| name: Default Schema Selection | ||
| description: Set the default PostgreSQL schema for all database queries at construction time; must be a schema exposed by the PostgREST configuration. | ||
| group: request-config | ||
| - id: client.request_config.db_timeout |
There was a problem hiding this comment.
I think this is the same capability as id: database.config.request_timeout in database.yaml
There was a problem hiding this comment.
Same approach as schema_selection — keeping database.configuration.request_timeout as the single entry, dropping client.request_configuration.db_timeout. Spec will cover both construction-time default and per-request override.
| name: Auto-Refresh Token Toggle | ||
| description: Disable the SDK's background token refresh loop so the application manages token renewal explicitly. | ||
| group: session-management | ||
| - id: client.request_config.custom_http_client |
There was a problem hiding this comment.
we have in database.yaml
- id: database.config.custom_http_client
and in functions.yaml
- id: functions.invocation.custom_http_client
I think we should pick one location. If we keep both client-level and sub-client level, I think we need a rule explaining when each applies, or every SDK will declare both and the matrix carries no signal.
There was a problem hiding this comment.
Same — keeping client.request_configuration.custom_http_client as the single canonical entry (it's the most general scope: set at construction, propagated to all sub-clients) and dropping the database and functions duplicates. Spec will note that per-sub-client configuration is also in scope.
| name: Query Vectors (similarity search) | ||
| description: Search for similar vectors in an index using a query vector. | ||
| group: vector-buckets | ||
| - id: storage.vector_buckets.create_vector_bucket |
There was a problem hiding this comment.
- id: storage.vector_buckets.create_vector_bucket
- id: storage.vector_buckets.list_vector_buckets
- id: storage.vector_buckets.delete_vector_bucket
This woud add vector-bucket create/list/delete alongside the existing file-bucket create_bucket / list_buckets / delete_bucket. Same API shape, different endpoints.
So, what should we do? One capability per bucket kind, or one shared? If shared, we should drop these. If separate, file-bucket entries should rename to create_file_bucket etc. for symmetry, and analytics buckets already follow the per-kind pattern.
There was a problem hiding this comment.
Going per-kind. Renamed file-bucket lifecycle to create_file_bucket / list_file_buckets / delete_file_bucket, and analytics to create_analytics_bucket / list_analytics_buckets / delete_analytics_bucket. Vector bucket names were already in the right shape.
| title: File Buckets | ||
| - id: vector-buckets | ||
| title: Vector Buckets | ||
| - id: transforms |
There was a problem hiding this comment.
The transforms group sits alongside file-buckets, but download_with_transform lives inside file-buckets. Image transforms aren't standalone capabilities, they're parameters that apply to download and signed-URL operations.
So I think we should either:
- Fold
image_resize/image_quality/image_formatinto modifiers ondownload_with_transformandcreate_signed_url(and drop thetransformsgroup), or - Move
download_with_transforminto thetransformsgroup so all transform-related entries cluster together.
There was a problem hiding this comment.
Dropped the transforms group and the three parameter entries. Transform parameters will be documented in the spec for download_with_transform.
| name: Custom Logger | ||
| description: Provide a custom logging function and log level filter at construction time to route Realtime client diagnostics to an application logger. | ||
| group: config | ||
| - id: realtime.config.binary_protocol |
There was a problem hiding this comment.
I think this mixes two distinct capabilities: (a) "supports the v2 binary protocol" which is a real, language-neutral server feature, and (b) "supports caller-supplied encode/decode functions" which is JS-only plumbing. I think we should either split into two entries or trim the description to (a) only
There was a problem hiding this comment.
Trimmed to protocol version selection only — the custom encode/decode is JS-specific. Updated description: "Select protocol version 2.0.0 for binary-serialized messages over the WebSocket connection."
|
Oh, one more thing. The vector-bucket lifecycle entries here: I consolidated on purpose these. Do we think we should unconsolidate? |
Extends the capability matrix with features exposed by supabase-js that are not trivially represented as a single method call — initialization options, implicit behaviors, callback hooks, and advanced configuration. New area: - client.yaml: 16 features covering SupabaseClient cross-cutting config (third-party auth via accessToken callback, custom session storage, SSR mode, global headers, OpenTelemetry trace propagation, etc.) Added features to existing areas: - database: auto-retry with backoff, custom fetch, request timeout, abort signal, strip nulls, override response type, relationship embed - realtime: postgres changes row filter, private channels (RLS), broadcast self-delivery/ack/replay, custom WebSocket transport, dynamic access token callback, worker heartbeat, binary protocol, reconnect backoff, deferred disconnect, custom logger - storage: image resize/quality/format transforms, cross-bucket move/copy, upload metadata, URL cache nonce, streaming download, vector bucket management, Iceberg analytics buckets - functions: streaming response (SSE), region selection, timeout, abort signal, response type detection, typed error classes, custom fetch, HTTP method override Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Remove features that are JS/TypeScript-specific and cannot be implemented generically across all SDK languages: - database.using_modifiers.override_response_type (TypeScript type system only) - realtime.config.worker_heartbeat (Web Worker API, browser/JS only) - client.session_management.storage_key (JS localStorage key naming) - client.session_management.ssr_mode (SSR / Next.js specific) - client.observability.auth_debug (supabase-js internal debug mode) Rename JS-specific terminology to language-neutral equivalents: - "fetch" → "HTTP client" in database, functions, and client config - "AbortSignal" → "request cancellation" in database and functions - Remove implementation-specific details from descriptions (AbortController, React Native, @opentelemetry/api package, localStorage interface) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…hema Replace underscores with hyphens in all feature IDs, group IDs, and area names across every capability YAML file. Update the JSON schema regex patterns to reject snake_case going forward. Rename the specs/auth/sign_in directory to specs/auth/sign-in to match. Update all tests and fixtures. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Convert all feature IDs, group IDs, and group references to snake_case throughout every capability YAML file. Update JSON schema patterns to enforce snake_case (reject hyphens) for area names, group IDs, and three-segment feature IDs. Rename specs/auth/sign_in directory and update all tests and fixtures. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace auth_integration → authentication_integration, config → configuration, and request_config → request_configuration in all group declarations, group references, and feature IDs across client.yaml, database.yaml, and realtime.yaml. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
7321ca3 to
65332b8
Compare
905238a to
40b9f6e
Compare
- Drop client.session_management.auto_refresh_token (covered by auth.session.auto_refresh) - Drop client.request_configuration.schema_selection and db_timeout (consolidated into single capabilities in database.yaml) - Drop client.request_configuration.custom_http_client duplicate from database.yaml and functions.yaml; keep single entry in client.yaml - Rename file-bucket lifecycle operations to create_file_bucket/list_file_buckets/delete_file_bucket for per-kind symmetry - Rename analytics lifecycle operations to create_analytics_bucket/list_analytics_buckets/delete_analytics_bucket - Drop storage transforms group and image_resize/image_quality/image_format entries - Trim realtime.configuration.binary_protocol description to protocol version selection only Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
40b9f6e to
d39ee04
Compare
QuintinWillison
left a comment
There was a problem hiding this comment.
Thanks for addressing my previous comments. My approval carries way less weight than a nod from others who have more platform knowledge.
* feat: add capabilities based on supabase-js public methods * fix: update capabilities * feat: namespace capability IDs (area.namespace.method) * feat: adopt grdsdev canonical renames Co-authored-by: Guilherme Souza <[email protected]> * Update capabilities/auth.yaml Co-authored-by: Lukas Klingsbo <[email protected]> * Update capabilities/realtime.yaml Co-authored-by: Lukas Klingsbo <[email protected]> * feat: add non-obvious capabilities to the matrix (#22) * feat: add non-obvious capabilities to the matrix Extends the capability matrix with features exposed by supabase-js that are not trivially represented as a single method call — initialization options, implicit behaviors, callback hooks, and advanced configuration. New area: - client.yaml: 16 features covering SupabaseClient cross-cutting config (third-party auth via accessToken callback, custom session storage, SSR mode, global headers, OpenTelemetry trace propagation, etc.) Added features to existing areas: - database: auto-retry with backoff, custom fetch, request timeout, abort signal, strip nulls, override response type, relationship embed - realtime: postgres changes row filter, private channels (RLS), broadcast self-delivery/ack/replay, custom WebSocket transport, dynamic access token callback, worker heartbeat, binary protocol, reconnect backoff, deferred disconnect, custom logger - storage: image resize/quality/format transforms, cross-bucket move/copy, upload metadata, URL cache nonce, streaming download, vector bucket management, Iceberg analytics buckets - functions: streaming response (SSE), region selection, timeout, abort signal, response type detection, typed error classes, custom fetch, HTTP method override Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: remove language/framework-specific features from capability matrix Remove features that are JS/TypeScript-specific and cannot be implemented generically across all SDK languages: - database.using_modifiers.override_response_type (TypeScript type system only) - realtime.config.worker_heartbeat (Web Worker API, browser/JS only) - client.session_management.storage_key (JS localStorage key naming) - client.session_management.ssr_mode (SSR / Next.js specific) - client.observability.auth_debug (supabase-js internal debug mode) Rename JS-specific terminology to language-neutral equivalents: - "fetch" → "HTTP client" in database, functions, and client config - "AbortSignal" → "request cancellation" in database and functions - Remove implementation-specific details from descriptions (AbortController, React Native, @opentelemetry/api package, localStorage interface) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * refactor: convert all capability IDs to kebab-case and enforce via schema Replace underscores with hyphens in all feature IDs, group IDs, and area names across every capability YAML file. Update the JSON schema regex patterns to reject snake_case going forward. Rename the specs/auth/sign_in directory to specs/auth/sign-in to match. Update all tests and fixtures. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * refactor: use snake_case for all capability IDs and enforce via schema Convert all feature IDs, group IDs, and group references to snake_case throughout every capability YAML file. Update JSON schema patterns to enforce snake_case (reject hyphens) for area names, group IDs, and three-segment feature IDs. Rename specs/auth/sign_in directory and update all tests and fixtures. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * refactor: expand abbreviated group IDs in capability matrix Replace auth_integration → authentication_integration, config → configuration, and request_config → request_configuration in all group declarations, group references, and feature IDs across client.yaml, database.yaml, and realtime.yaml. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: address review comments on capability structure - Drop client.session_management.auto_refresh_token (covered by auth.session.auto_refresh) - Drop client.request_configuration.schema_selection and db_timeout (consolidated into single capabilities in database.yaml) - Drop client.request_configuration.custom_http_client duplicate from database.yaml and functions.yaml; keep single entry in client.yaml - Rename file-bucket lifecycle operations to create_file_bucket/list_file_buckets/delete_file_bucket for per-kind symmetry - Rename analytics lifecycle operations to create_analytics_bucket/list_analytics_buckets/delete_analytics_bucket - Drop storage transforms group and image_resize/image_quality/image_format entries - Trim realtime.configuration.binary_protocol description to protocol version selection only Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Guilherme Souza <[email protected]> Co-authored-by: Lukas Klingsbo <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
Extends the capability matrix with non-obvious features exposed by the Supabase SDK — initialization options, implicit behaviors, callback hooks, and advanced configuration that are not trivially represented as a single method call but that any SDK implementation should support.
All features are language-neutral. Feature IDs use snake_case; schema validation enforces this.
client(+9) — third-party auth, cross-client JWT sync, OAuth flow/redirect config, pluggable session storage, session persistence toggle, custom HTTP client, global headers, trace propagation.database(+5) — auto-retry, request timeout, request cancellation, strip-null fields, relationship embedding.functions(+7) — streaming response, region selection, invocation timeout, request cancellation, response type detection, HTTP method override, typed errors.realtime(+13) — Postgres changes row filter, private channel (RLS), broadcast self/ack/replay, custom presence key, custom WebSocket transport, reconnect backoff, heartbeat interval, access token callback, deferred disconnect, custom logger, binary protocol (v2).storage(+18) — per-kind bucket lifecycle, cross-bucket copy/move, upload with metadata, URL cache nonce, streaming download, download with transform, vector bucket management, Iceberg analytics buckets.Test plan
npm run validatepassesnpm testpasses (36/36)🤖 Generated with Claude Code