Repository navigation
docs(dart): OAuth server, custom providers, realtime heartbeat & explain reference updates - #47728
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUpdates the Dart v2 API specification with taxonomy metadata, OAuth Server and custom provider APIs, Realtime examples, heartbeat events, and explain formats. The reference generator now derives method sections directly from YAML metadata. ChangesDart v2 API reference updates
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3627642 to
e23e990
Compare
e23e990 to
b81de65
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/docs/spec/supabase_dart_v2.yml (1)
5756-5792: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd an example demonstrating
format: ExplainFormat.json.The
formatparam and description (line 5790: "can also be returned as JSON by using theformatparameter") reference JSON output, but neither example underexplainactually shows passingformat: ExplainFormat.json. Consider adding a short example for discoverability, consistent with how other new params (e.g.,analyze/verbose) get their own example.Suggested addition
- id: get-execution-plan-with-analyze-and-verbose name: Get the execution plan with analyze and verbose ... isSpotlight: false + - id: get-execution-plan-as-json + name: Get the execution plan as JSON + code: | + ```dart + final data = await supabase + .from('instruments') + .select() + .explain(format: ExplainFormat.json); + ``` + isSpotlight: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/spec/supabase_dart_v2.yml` around lines 5756 - 5792, Add a dedicated `explain` example that shows passing `format: ExplainFormat.json` on the `supabase.from('instruments').select().explain(...)` call so the documented JSON output is discoverable. Update the examples block near `get-execution-plan` to include a short JSON-format sample, keeping it consistent with the existing `analyze` and `verbose` examples and referencing the `format` parameter in `ExplainFormat`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/docs/spec/supabase_dart_v2.yml`:
- Around line 5756-5792: Add a dedicated `explain` example that shows passing
`format: ExplainFormat.json` on the
`supabase.from('instruments').select().explain(...)` call so the documented JSON
output is discoverable. Update the examples block near `get-execution-plan` to
include a short JSON-format sample, keeping it consistent with the existing
`analyze` and `verbose` examples and referencing the `format` parameter in
`ExplainFormat`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a2224530-f883-4622-be85-9ef7b0948929
📒 Files selected for processing (3)
apps/docs/spec/common-client-libs-sections.jsonapps/docs/spec/supabase_dart_v2.ymlapps/docs/spec/supabase_js_v2.yml
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/docs/spec/common-client-libs-sections.json
- apps/docs/spec/supabase_js_v2.yml
ChrisChinchilla
left a comment
There was a problem hiding this comment.
I think until I feel more comfortable, @jeremenichelli is the best person to review this
|
@spydon I am surprised you are using the new script to generate the reference page, but also you need to maintain the But that's up to you. Don't know if there's other reason why it still needs to be like this. |
|
@jeremenichelli yeah that looks quite inefficient, fixed it up here: #47994 to that we only rely on the yaml instead |
…ants, and July additions Adds Dart reference entries and enrichments for supabase-flutter features shipped July 8 to 15. Uses the new reference pipeline (stacked on #47994): sections come from category/subcategory fields on each YAML entry, so common-client-libs-sections.json is not touched. New entries: - storage: vector buckets (create/get/list/delete bucket, index management, and vector put/get/list/query/delete) under a new "Vector Buckets" section - storage: analytics (Iceberg) buckets and the analytics catalog accessor under a new "Analytics Buckets" section - storage: listPaginated (list files v2) - auth: signInWithWeb3 - auth: OAuth server listGrants and revokeGrant under a new "OAuth Server" section - database: stripNulls modifier Enrichments to existing entries: - storage: cacheNonce on getPublicUrl/createSignedUrl/download, and filter/sort/pagination options on listBuckets - auth: mfa.challenge channel, updateUser currentPassword, async getSession - functions: invoke abortSignal Adds partials for the three new subcategories (analytics-buckets, vector-buckets, oauth-server) and registers their group-header ids in HEADER_IDS so the converter treats them as section overviews. Excludes items already covered by #47728 (OAuth server authorization details, custom providers admin, explain format, realtime onHeartbeat and filter examples).
39d07f9 to
89d1acb
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/spec/reference/dart/v2/partials/custom-provider-admin.json`:
- Line 4: Mark custom-provider administration as trusted-server-only in both
apps/docs/spec/reference/dart/v2/partials/custom-provider-admin.json (line 4)
and apps/docs/spec/supabase_dart_v2.yml (lines 3015-3019) by adding the warning
that the required secret must never be exposed in Flutter or used client-side.
In `@apps/docs/spec/supabase_dart_v2.yml`:
- Around line 2389-2407: The get-authorization-details example must handle both
response variants from getAuthorizationDetails. Update the example to detect
OAuthAuthorizationRedirectResponse and immediately forward its redirectUrl; only
render or process the consent screen for OAuthAuthorizationDetailsResponse.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c7f29d7c-1706-4561-845e-e6e2c0ea69b4
📒 Files selected for processing (4)
apps/docs/scripts/generate-dart-reference.tsapps/docs/spec/reference/dart/v2/partials/custom-provider-admin.jsonapps/docs/spec/reference/dart/v2/partials/oauth-server.jsonapps/docs/spec/supabase_dart_v2.yml
|
@spydon the burden is more on your side, since it adds tons of steps for authoring new methods, removing deprecated, etc. So, up to you and the team if you want to fix the adapter or keep it this way. |
Previously the Dart v2 reference derived each method's section from common-client-libs-sections.json, which meant maintaining that nav file in lockstep with the spec YAML. This makes the spec YAML self-describing instead: each section-header entry (e.g. `auth-mfa-api`, `file-buckets`, and the new top-level `auth-api`, `database-api`, `functions-api`, `realtime-api`) carries the `category` and optional `subcategory` that every method after it inherits, up to the next header. Individual methods carry no section metadata, so authoring a new method just means placing it in the right section, and adding a section is one header entry plus its partial. `generate-dart-reference.ts` walks the spec in order, tracking the current section from the most recent header. A method may still override the section explicitly, and the converter errors if a method appears before any header. The generated navigation is byte-for-byte identical to before.
0f5d0ba to
9d12ca7
Compare
…ants, and July additions Adds Dart reference entries and enrichments for supabase-flutter features shipped July 8 to 15. Stacked on #47994: methods carry no section metadata and inherit it from the nearest section header. New sections are added as header entries (with category/subcategory) plus overview partials. New sections and entries: - storage: Vector Buckets section (create/get/list/delete bucket, index management, and vector put/get/list/query/delete) - storage: Analytics Buckets section (analytics catalog accessor and bucket create/list/delete) - storage: listPaginated (list files v2) under File Buckets - auth: signInWithWeb3 - auth: OAuth Server section with listGrants and revokeGrant - database: stripNulls modifier Enrichments to existing entries: - storage: cacheNonce on getPublicUrl/createSignedUrl/download, and filter/sort/pagination options on listBuckets - auth: mfa.challenge channel, updateUser currentPassword, async getSession - functions: invoke abortSignal Adds partials for the three new sections and registers their header ids in the converter's HEADER_IDS. Excludes items already covered by #47728.
89d1acb to
c62001c
Compare
The converter ignored an explicit `subcategory` when a method did not also set `category`, so a subcategory-only override silently fell back to the inherited value. Check for `subcategory` presence directly.
…ain reference updates Adds Dart reference entries for supabase-flutter features (parity with supabase-js). Stacked on #47994: methods carry no section metadata and inherit it from the nearest section header. New sections are added as header entries (with category/subcategory) plus overview partials. - auth: OAuth 2.1 server authorization API (oauth.getAuthorizationDetails/ approveAuthorization/denyAuthorization) as a new "OAuth Server" section - auth admin: custom OIDC/OAuth providers admin API (admin.customProviders.list/create/get/update/delete) as a new "Custom Provider Admin" section - realtime: onHeartbeat, plus onPostgresChanges pattern/negated/multi-filter and column-selection examples - postgrest: explain() format option Adds partials for the two new sections and registers their header ids in the converter's HEADER_IDS. Source PRs: supabase-flutter #1499, #1516, #1517, #1519, #1526.
…docs - Mark the custom provider admin API as server-only (trusted server, never expose the secret key in the Flutter app) in both the overview partial and the YAML source, matching the auth admin overview. - Show getAuthorizationDetails() handling both response variants: forward the redirectUrl for OAuthAuthorizationRedirectResponse (already-consented) and render the consent screen only for OAuthAuthorizationDetailsResponse.
c62001c to
47d6c44
Compare
…ants, and July additions Adds Dart reference entries and enrichments for supabase-flutter features shipped July 8 to 15. Stacked on #47994: methods carry no section metadata and inherit it from the nearest section header. New sections are added as header entries (with category/subcategory) plus overview partials. New sections and entries: - storage: Vector Buckets section (create/get/list/delete bucket, index management, and vector put/get/list/query/delete) - storage: Analytics Buckets section (analytics catalog accessor and bucket create/list/delete) - storage: listPaginated (list files v2) under File Buckets - auth: signInWithWeb3 - auth: OAuth Server section with listGrants and revokeGrant - database: stripNulls modifier Enrichments to existing entries: - storage: cacheNonce on getPublicUrl/createSignedUrl/download, and filter/sort/pagination options on listBuckets - auth: mfa.challenge channel, updateUser currentPassword, async getSession - functions: invoke abortSignal Adds partials for the three new sections and registers their header ids in the converter's HEADER_IDS. Excludes items already covered by #47728.
I misunderstood the first comment, now it shouldn't be any manual overhead after #47994 is merged. :) |
…es-20260707 # Conflicts: # apps/docs/scripts/generate-dart-reference.ts # apps/docs/spec/supabase_dart_v2.yml
Braintrust eval report
|
…ants, and July additions Adds Dart reference entries and enrichments for supabase-flutter features shipped July 8 to 15. Stacked on #47994: methods carry no section metadata and inherit it from the nearest section header. New sections are added as header entries (with category/subcategory) plus overview partials. New sections and entries: - storage: Vector Buckets section (create/get/list/delete bucket, index management, and vector put/get/list/query/delete) - storage: Analytics Buckets section (analytics catalog accessor and bucket create/list/delete) - storage: listPaginated (list files v2) under File Buckets - auth: signInWithWeb3 - auth: OAuth Server section with listGrants and revokeGrant - database: stripNulls modifier Enrichments to existing entries: - storage: cacheNonce on getPublicUrl/createSignedUrl/download, and filter/sort/pagination options on listBuckets - auth: mfa.challenge channel, updateUser currentPassword, async getSession - functions: invoke abortSignal Adds partials for the three new sections and registers their header ids in the converter's HEADER_IDS. Excludes items already covered by #47728.
…s, and July additions (#47971) ## What Updates the Dart/Flutter reference (`apps/docs/spec/supabase_dart_v2.yml`) for features shipped in [`supabase/supabase-flutter`](https://github.com/supabase/supabase-flutter) in July (through the July 17 storage CDN-cache additions). Built on the **new reference pipeline** (#47224 / #47994): each method's section is inherited from the nearest section-header entry in the YAML, and subcategory overviews are committed partials under `spec/reference/dart/v2/partials/`. `common-client-libs-sections.json` is **not** touched. Scoped to items **not** already covered by #47728 (OAuth server authorization details, custom providers admin, `explain` format, realtime `onHeartbeat` and filter examples). Rebased onto `master` now that #47994 and #47728 have landed. ## New reference entries **Storage** - Vector buckets (new **Vector Buckets** section): create/get/list/delete bucket, index create/get/list/delete/access, and vector put/get/list/query/delete (`supabase.storage.vectors`) - Analytics (Iceberg) buckets (new **Analytics Buckets** section): `createAnalyticsBucket`, `listAnalyticsBuckets`, `deleteAnalyticsBucket`, and the `analyticsCatalog()` accessor - `listPaginated` (list files v2), under File Buckets - `downloadStream()` (streaming file downloads), under File Buckets - `purgeCache()` (object CDN cache invalidation) and `purgeBucketCache()` (bucket CDN cache invalidation) **Auth** - `signInWithWeb3` - OAuth server `listGrants` and `revokeGrant` (in the **OAuth Server** section, `supabase.auth.oauth`) **Database** - `stripNulls()` modifier ## Enrichments to existing entries - Storage: `cacheNonce` on `getPublicUrl` / `createSignedUrl` / `download`; filter/sort/pagination options on `listBuckets` - Auth: `channel` on `mfa.challenge()`; `currentPassword` on `updateUser`; async `getSession()` note and example; `friendlyName` on `registerPasskey()` and `passkey.startRegistration()` - Functions: `abortSignal` on `invoke` ## Pipeline plumbing - New partials: `analytics-buckets.json`, `vector-buckets.json`, `oauth-server.json` - `generate-dart-reference.ts`: registers `analytics-buckets`, `vector-buckets`, and `oauth-server-api` group-header ids in `HEADER_IDS` so they render as section overviews rather than methods ## Source PRs supabase-flutter: #1547, #1554, #1557, #1559, #1561, #1563, #1578, #1579, #1580, #1585, #1588, #1590, #1591, #1593, #1603, #1607, #1608 ## Verification `pnpm codegen:references:dart` builds cleanly: the generator writes 141 method declarations (all ids resolve to a section, no invalid method names, no slug collisions), and the nav renders the Analytics Buckets, Vector Buckets, and OAuth Server sections with the expected methods. ## Notes - Skipped (no reference home / would need product decisions): Iceberg namespace/table management (the full `IcebergRestCatalog` API, which lives in a standalone `iceberg-js` package upstream), `dryRun`, functions exception subtypes, trace-context headers, `persistSession`, configurable postgrest timeout/retry. - `storageanalytics-from` maps to Dart's `analyticsCatalog(bucketId)` (the Iceberg catalog entry point), since Dart has no `analytics.from()` equivalent. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded Dart docs with Web3 sign-in plus passkey, MFA channel, and OAuth grant listing/revocation. * Added storage APIs/examples for listing buckets with options, CDN cache bypass via `cacheNonce`, and cache/purge support. * Documented `stripNulls()` database modifier and cursor-based paginated storage listing. * **Documentation** * Updated auth references with optional `currentPassword`, `friendlyName`, and clarified `currentSession` vs `getSession()`. * Added `abortSignal` support and examples for `supabase.functions.invoke()`. * **Bug Fixes** * Improved Dart reference generation so analytics/vector bucket sections aren’t emitted as method declarations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What
Adds Dart client library reference entries (
apps/docs/spec/supabase_dart_v2.yml) for features shipped insupabase/supabase-flutter(parity withsupabase-js).Rebuilt on the new reference pipeline (#47224 / #47994): each method's section comes from
category/subcategoryfields on its own YAML entry, with subcategory overviews as committed partials underspec/reference/dart/v2/partials/. As a result this PR no longer touchescommon-client-libs-sections.jsonorsupabase_js_v2.yml(the earlier shared-nav id rename is unnecessary now that Dart no longer reads that file).Changes
Auth (OAuth 2.1 server) — new OAuth Server section
oauth.getAuthorizationDetails(),oauth.approveAuthorization(),oauth.denyAuthorization()Auth admin — new Custom Provider Admin section
admin.customProviders.listProviders/createProvider/getProvider/updateProvider/deleteProvider, includingcustomClaimsAllowlistRealtime
onHeartbeatonPostgresChangesexamples for the new pattern/negated filter operators, multiple filters, and column selectionPostgrest
explain()formatoption (ExplainFormat.text/.json)Pipeline plumbing
oauth-server.json,custom-provider-admin.jsongenerate-dart-reference.ts: registersoauth-server-apiandadmin-custom-providers-apigroup-header ids inHEADER_IDSSource PRs
supabase-flutter: #1499, #1516, #1517, #1519, #1526
Verification
pnpm codegen:references:newbuilds cleanly and the nav renders the new OAuth Server, Custom Provider Admin, and Realtime onHeartbeat entries.Notes
RealtimeChannelConfig.replicationReady(# Improve documentation #1526) is omitted since there is no reference slot for channel-config options.listGrants/revokeGrant). Whichever lands second should drop the duplicate section header/partial and keep both sets of methods.Summary by CodeRabbit
New Features
Documentation