Skip to content

Add schemaName support, docs, test, and release notes for Supabase replication custom schema#7983

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/add-docs-and-test-for-pr-7963
Draft

Add schemaName support, docs, test, and release notes for Supabase replication custom schema#7983
Copilot wants to merge 4 commits intomasterfrom
copilot/add-docs-and-test-for-pr-7963

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

  • Understand PR Feature/supabase schemas #7963: adds schemaName option to Supabase replication plugin
  • Apply code changes from PR Feature/supabase schemas #7963 to src/plugins/replication-supabase/index.ts and src/plugins/replication-supabase/types.ts
  • Add migration for custom Postgres schema (private) for testing
  • Add test for schemaName option in test/replication-supabase.test.ts
  • Add documentation for schemaName in docs-src/docs/replication-supabase.md
  • Add schemaName feature entry to docs-src/docs/releases/17.0.0.md
  • Fix test breakage: only call client.schema() for non-public schemas to avoid Accept-Profile header causing "operation was canceled" errors in PostgREST

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… schema replication

Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation and tests for pull request 7963 Add schemaName support, docs, and test for Supabase replication custom schema Mar 7, 2026
@pubkey
Copy link
Owner

pubkey commented Mar 7, 2026

@copilot also add this info to 17.0.0.md

Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 7, 2026

@copilot also add this info to 17.0.0.md

Added in commit 40d30f5 — the schemaName entry is now in the 🗄️ Storage, Queries & Replication Fixes section of docs-src/docs/releases/17.0.0.md.

Copilot AI changed the title Add schemaName support, docs, and test for Supabase replication custom schema Add schemaName support, docs, test, and release notes for Supabase replication custom schema Mar 7, 2026
@pubkey
Copy link
Owner

pubkey commented Mar 7, 2026

@copilot this breaks the supabase tests:

replication-supabase.test.ts
basics
✔ init
✔ should be empty
✔ insert documents
live:false push
-------------- RxDB Open Core RxStorage -------------------------------
You are using the free Dexie.js based RxStorage implementation from RxDB https://rxdb.info/rx-storage-dexie.html?console=dexie
While this is a great option, we want to let you know that there are faster storage solutions available in our premium plugins.
For professional users and production environments, we highly recommend considering these premium options to enhance performance and reliability.
https://rxdb.info/premium/?console=dexie
If you already purchased premium access you can disable this log by calling the setPremiumFlag() function from rxdb-premium/plugins/shared.

  ✔ should push the inserted documents (196ms)
  ✔ should have pushed the updated documents (49ms)
live:false pull
  ✔ should pull the documents (108ms)
pull query builder
  ✔ should allow restricting the pull query
deletes
  ✔ should push the deletion (262ms)
conflict handling
  ✔ INSERT: should keep the master state as default conflict handler (54ms)
  ✔ UPDATE: should keep the master state as default conflict handler (80ms)
  ✔ conflict on delete (95ms)
live replication
  ✔ push replication to client-server (51ms)
  ✔ should get the event from server-side changes and sync the new data (43ms)
other

... 0
... 1
... 2
... 3
... 3.1
... 3.2
... 4
... 5
Error: The operation was canceled.

…rs in tests

Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 7, 2026

@copilot this breaks the supabase tests:

replication-supabase.test.ts
...

Fixed in commit 056dc69. The root cause was that calling client.schema('public') sends an explicit Accept-Profile: public HTTP header which some PostgREST setups reject, causing the "operation was canceled" error. The fix introduces a schemaClient variable that uses client.schema(schemaName) only when the schema is not 'public', and falls back to the plain client otherwise — preserving the original behavior for the default public schema.

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.

2 participants