Skip to content

fix(realtime): include the requested vsn in the unsupported serializer error - #2812

Merged
cmelchior merged 1 commit into
supabase:masterfrom
ramiscaleai:fix/realtime-unsupported-vsn-message
Nov 3, 2026
Merged

cmelchior merged 1 commit into
supabase:masterfrom
ramiscaleai:fix/realtime-unsupported-vsn-message

Conversation

@ramiscaleai

Copy link
Copy Markdown
Contributor

Description

What changed?

_initializeOptions now uses the local vsn in the "Unsupported serializer version" error, and the existing test asserts the full message.

Why was this change needed?

#2170 moved result.vsn = vsn below the switch, so the default branch reads an unset result.vsn. As a result, new RealtimeClient(url, { vsn: '4.0.0' }) throws Unsupported serializer version: undefined. Since vsn is now typed string, this error is the only hint a user gets for a mistyped version. There is no issue for this; I'm happy to open one if you prefer.

Breaking changes

  • This PR contains no breaking changes

Checklist

  • I have read the contributing guidelines, and the PR title follows the conventional format
  • The Prettier check passes on the changed files
  • The test was updated: it fails on master and passes here

Testing

  • npx vitest run test/RealtimeClient.config.test.ts -t "unsupported version": fails on master (Received: "Unsupported serializer version: undefined") and passes here
  • pnpm nx test realtime-js: 475 passed, 1 skipped
  • pnpm nx build realtime-js and tsc --noEmit: pass

Prepared with AI assistance (Claude Code); the tests above were run locally.

🤖 Generated with Claude Code

…r error

The default branch of the vsn switch in _initializeOptions interpolates
result.vsn, which is only assigned after the switch. Passing an
unsupported vsn therefore throws "Unsupported serializer version:
undefined". Use the local vsn instead, and assert the full message in
the existing test.

Regressed in supabase#2170.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ramiscaleai
ramiscaleai requested review from a team as code owners November 3, 2026 03:03
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Unsupported serializer version errors now display the configured version, making the error message more specific.

When an unsupported serializer version is configured, the error message now reports the configured vsn value. The test checks that the error equals Unsupported serializer version: 4.0.0.

Suggested labels: realtime-js

Change: Bug fix

Merge Risk: Minimal · up to 536b6

Unsupported serializer errors now identify the requested version. No actionable merge-blocking risk is established; merge after normal checks pass.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 10d53158-06b8-42af-b848-840ed8515069
Commits

Reviewing files that changed from the base of the PR and between ecab7fb and 536b685.

Files selected for processing: 2
  • packages/core/realtime-js/src/RealtimeClient.ts
  • packages/core/realtime-js/test/RealtimeClient.config.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2812

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2812

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2812

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2812

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2812

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2812

commit: 536b685

@cmelchior cmelchior self-assigned this Nov 3, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.652% (+13.2%) from 82.422% — ramiscaleai:fix/realtime-unsupported-vsn-message into supabase:master

@cmelchior cmelchior left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ramiscaleai Thank you very much for fixing this. Looking good 👍

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.

3 participants