Skip to content

feat(realtime): add postgres_changes_wait capability - #106

Open
grdsdev wants to merge 2 commits into
mainfrom
guilherme/sdk-1650-realtime-postgres-changes-wait
Open

feat(realtime): add postgres_changes_wait capability#106
grdsdev wants to merge 2 commits into
mainfrom
guilherme/sdk-1650-realtime-postgres-changes-wait

Conversation

@grdsdev

@grdsdev grdsdev commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Registers realtime.subscriptions.postgres_changes_wait — the wait-for-server-confirmation option on postgres_changes subscriptions (postgres_changes_options.wait / .timeout), added to supabase-js in supabase-js#2630.
  • Adds a spec at specs/realtime/subscriptions/postgres_changes_wait.md describing the behavior, prerequisites, and error/timeout conditions in SDK-neutral terms.

Test plan

  • npm run validate — OK, capability matrix is valid
  • npm test — 195 passed
  • npm run typecheck — clean

Refs SDK-1650

Registers the wait-for-server-confirmation option on postgres_changes
subscriptions (see supabase-js#2630) so SDKs can declare compliance
against a stable feature ID.
@grdsdev
grdsdev requested a review from a team as a code owner August 28, 2026 09:11
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 424f6272-e107-499f-8fdd-7f6265fbf62b

📥 Commits

Reviewing files that changed from the base of the PR and between 698264c and 1b0489b.

📒 Files selected for processing (3)
  • .claude/skills/capability-matrix/SKILL.md
  • packages/capability-matrix/specs/TEMPLATE.md
  • packages/capability-matrix/specs/realtime/subscriptions/postgres_changes_wait.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/capability-matrix/specs/realtime/subscriptions/postgres_changes_wait.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added an opt-in option to wait for confirmation that Postgres change subscriptions are active and streaming.
    • Added configurable subscription confirmation timeouts, with a default of 15 seconds.
    • Documented prerequisites, behavior, and possible errors. Existing subscription behavior remains unchanged unless the option is enabled.

Walkthrough

The change adds the realtime.subscriptions.postgres_changes_wait capability. It documents postgres_changes_options.wait and postgres_changes_options.timeout. When enabled, subscription success waits for server confirmation that Postgres change streaming is active. The specification documents prerequisites, unconfirmed-subscription and timeout errors, default behavior, and related specifications. The specification template and authoring guidance now place platform details in ## Behavior or ## Prerequisites and remove the separate ## Notes section.

Merge Risk: ⚪ Minimal · up to 1b048

This localized change documents and registers the PostgreSQL changes confirmation-wait capability without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.


## Prerequisites

Only meaningful on a channel with a `postgres_changes` binding; has no effect on channels without one. Requires a Realtime server version that sends the subscription-active confirmation message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps including that server version here might be useful.


- Without `wait: true`, a successful subscription is reported on channel join regardless of postgres_changes streaming state — the existing default behavior is unchanged for callers who don't opt in.

## Related

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the GitHub renderer these links don't work... is there tooling downstream that comprehends them? They're nominally relative in nature but when that's interpreted for this markdown document then they're clearly invalid. 😕

- subscription not confirmed — the server responds with `wait` enabled but the subscription cannot be confirmed active (e.g. replication setup failure); the subscribe outcome carries the server's reason instead of a false success
- timeout — the server does not confirm within `postgres_changes_options.timeout` milliseconds

## Notes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've mentioned it in a couple of places before, but can quiet down on this if you prefer, but I'm not so sure 'Notes' on a document that itself is 'Notes'-in-nature, is a great sign of clarity. 🤔

A dedicated Notes section is redundant on a document that is already
free-form notes — fold platform/behavior asides into Behavior or
Prerequisites instead. Updates the template, the capability-matrix
skill's guidance, and the postgres_changes_wait spec.

Addresses review feedback on #106.
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