Repository navigation
fix(realtime): include the requested vsn in the unsupported serializer error - #2812
Conversation
…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]>
|
No actionable comments were generated in the recent review. Summary
Change: Bug fix Merge Risk:
|
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
cmelchior
left a comment
There was a problem hiding this comment.
Hi @ramiscaleai Thank you very much for fixing this. Looking good 👍
Description
What changed?
_initializeOptionsnow uses the localvsnin the "Unsupported serializer version" error, and the existing test asserts the full message.Why was this change needed?
#2170 moved
result.vsn = vsnbelow theswitch, so thedefaultbranch reads an unsetresult.vsn. As a result,new RealtimeClient(url, { vsn: '4.0.0' })throwsUnsupported serializer version: undefined. Sincevsnis now typedstring, 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
Checklist
Testing
npx vitest run test/RealtimeClient.config.test.ts -t "unsupported version": fails on master (Received: "Unsupported serializer version: undefined") and passes herepnpm nx test realtime-js: 475 passed, 1 skippedpnpm nx build realtime-jsandtsc --noEmit: passPrepared with AI assistance (Claude Code); the tests above were run locally.
🤖 Generated with Claude Code