-
Notifications
You must be signed in to change notification settings - Fork 606
Open
Open
Copy link
Labels
bugSomething isn't workingSomething isn't workingrepro neededIssue is missing a reproduction example.Issue is missing a reproduction example.supabase-jsRelated to the supabase-js library.Related to the supabase-js library.
Description
Describe the bug
Serializer.decode() crashes when the Realtime server sends a JSON object over the WebSocket instead of the expected array format. This crashes the entire process with an unhandled TypeError.
Library affected
supabase-js
Reproduction
No response
Steps to reproduce
- Subscribe to postgres_changes on a table
- Trigger an INSERT via a cron job or external process
- The Realtime server occasionally sends a non-array JSON message
- Process crashes with the stack trace below
System Info
- @supabase/supabase-js: ^2.56.0
- @supabase/realtime-js: 2.93.3
- Runtime: Deno 2.6.3
- Local Supabase via supabase startUsed Package Manager
npm
Logs
error: Uncaught TypeError: jsonPayload is not iterable
const [join_ref, ref, topic, event, payload] = jsonPayload;
^
at Serializer.decode (realtime-js/dist/main/lib/serializer.js:104:60)
at RealtimeClient._onConnMessage (realtime-js/dist/main/RealtimeClient.js:455:14)
at WebSocket.conn.onmessage (realtime-js/dist/main/RealtimeClient.js:519:47)
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Supabase JS Library issue and not an issue with the Supabase platform. If it's a Supabase platform related bug, it should likely be reported to supabase/supabase instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingrepro neededIssue is missing a reproduction example.Issue is missing a reproduction example.supabase-jsRelated to the supabase-js library.Related to the supabase-js library.