[pull] master from supabase:master#974
Merged
Merged
Conversation
… flow (#46473) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Docs update ## What is the current behavior? The access-control permissions matrix shows Developer-role users can create development branches, but doesn't mention the implicit production-branch registration step that runs on the first "Create branch" click for a gitless project — which is Owner/Administrator only. Customers reading the matrix conclude Developers can branch from the start; in reality, an Owner/Administrator has to perform the first branch creation to register the production branch. ## What is the new behavior? Adds a footnote on the "Development Branches → Create" row that flags the one-time first-branch admin requirement and links to the dashboard branching guide for the full explanation. Short cross-link only — long-form mechanism explanation lives on the dashboard branching guide (companion PR #46471). ## Additional context - Companion PR adding the long-form admonition on the branching guide page: #46471 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified branching permissions for dashboard (gitless) workflows: the first branch creation (one-time) without a GitHub integration requires Owner or Administrator to register the production branch; after that initial step, Developers may create, update, and delete branches as normal. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
New guide at `/guides/api/handling-errors-in-supabase-js` that leads
with `error.hint` as the most useful field on a Postgres error. When the
database knows the fix (a `GRANT` statement to run for a `42501`, a
column name you probably meant), it puts the literal SQL in `hint`.
Logging only `error.message` hides it.
The guide covers the `PostgrestError` shape (fields ordered by
usefulness: hint first, message last), branching on `error.code`, and
parallel patterns for Auth, Storage, Edge Functions, and Realtime.
Linked from the API > Guides sidebar next to the existing PostgREST
error codes reference.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a comprehensive guide on handling errors in supabase-js,
explaining the {data, error} pattern and recommending logging full error
objects.
* Provides a recommended error-handling pattern, guidance to branch on
error codes, and example error fields.
* Adds component-specific advice for Auth, Storage, Edge Functions, and
Realtime, plus a “Related” links section.
* Added a navigation entry so the guide appears in the API guides
submenu.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Behavior Changes** * Partial directives now render unprovided variables as empty strings instead of throwing validation errors * Escaped placeholders (preceded by backslash) are preserved and not substituted * Unused provided variables are silently ignored * **Tests** * Updated test coverage to validate the new permissive variable substitution behavior and removed prior error-focused assertions <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What changed Updated the S3 Vectors wrapper docs links in Studio to use the canonical `s3_vectors` docs slug instead of `s3-vectors`. ## Why The docs route on current `master` uses `/guides/database/extensions/wrappers/s3_vectors`, so these Studio links should point to the existing page. ## Validation Skipped local checks at request: this is a two-line URL-only update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Fixed documentation links for S3 Vectors integration to direct users to the correct reference guides. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Ali Waseem <waseema393@gmail.com>
…_KEYS (#46604) ## Problem Edge Function examples that use the new publishable/secret API keys read them with a double lookup: ```ts const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const secretKey = Deno.env.get(SUPABASE_SECRET_KEYS['default']) // ❌ returns undefined ``` `SUPABASE_SECRET_KEYS` / `SUPABASE_PUBLISHABLE_KEYS` are a JSON object that maps a key name to the **actual key value** (e.g. `{"default":"sb_secret_..."}`), confirmed by: - the self-hosted injection in `docker/docker-compose.yml` (`SUPABASE_SECRET_KEYS: "{\"default\":\"${SUPABASE_SECRET_KEY:-}\"}"`) - the `@supabase/server` SDK README So `SUPABASE_SECRET_KEYS['default']` is already the key. Wrapping it in another `Deno.env.get(...)` looks up an env var named `sb_secret_...`, which doesn't exist, so the value is `undefined` and the examples fail at runtime. ## Fix Unwrap the outer `Deno.env.get(...)` so the key is read directly: ```ts const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const secretKey = SUPABASE_SECRET_KEYS['default'] // ✅ ``` Applied across 23 files (example functions, the `examples/prompts/edge-functions.md` codegen guidance, and two docs guides). The correct `JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!)` declaration line is untouched. The generated `apps/docs/examples/` copy regenerates from `examples/` at build time. ## Notes - Docs context: [#46600](#46600), which documents the same key model. - Follow-up (not in this PR): a few examples send the secret key on the `Authorization: Bearer` header, which the new keys reject. Worth a separate audit. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified examples and guides for correctly reading parsed Supabase secret and publishable key maps. * **Examples** * Standardized credential usage across Edge Functions and samples so Supabase clients consistently receive keys from the parsed key maps rather than indirect lookups. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )