Skip to content

fix(realtime): throw Error objects instead of bare strings - #2256

Merged
mandarini merged 1 commit into
supabase:masterfrom
oniani1:fix/realtime-throw-error-objects
Apr 16, 2026
Merged

mandarini merged 1 commit into
supabase:masterfrom
oniani1:fix/realtime-throw-error-objects

Conversation

@oniani1

@oniani1 oniani1 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Closes #2255

Three locations in realtime-js throw or reject with bare strings instead of Error objects, breaking instanceof Error checks and losing stack traces:

  • RealtimeChannel.ts constructor (replay on public channel)
  • channelAdapter.ts push() -- catches an Error from upstream phoenix and re-throws as a string
  • RealtimeChannel.ts httpSend() -- rejects with a string while another reject in the same method correctly uses new Error()

Wrapped all three in new Error() and updated 2 test assertions from .rejects.toBe() to .rejects.toThrow().

@oniani1
oniani1 requested review from a team as code owners April 15, 2026 19:52
@pkg-pr-new

pkg-pr-new Bot commented Apr 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

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

@supabase/functions-js

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

@supabase/postgrest-js

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

@supabase/realtime-js

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

@supabase/storage-js

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

@supabase/supabase-js

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

commit: e20b853

@mandarini
mandarini merged commit 4c16408 into supabase:master Apr 16, 2026
22 checks passed
mandarini pushed a commit to supabase/ssr that referenced this pull request Apr 20, 2026
This PR updates `@supabase/supabase-js` to v2.104.0.

**Source**: supabase-js-stable-release

---

## Release Notes

## v2.104.0

## 2.104.0 (2026-04-20)

### 🚀 Features

- **storage:** extract shared header normalization utility
([#2251](supabase/supabase-js#2251))

### ❤️ Thank You

- Katerina Skroumpelou @mandarini
## v2.103.3

## 2.103.3 (2026-04-16)

### 🩹 Fixes

- **realtime:** throw Error objects instead of bare strings
([#2256](supabase/supabase-js#2256))
- **storage:** correct signedUrl type to allow null in createSignedUrls
([#2254](supabase/supabase-js#2254))

### ❤️ Thank You

- Katerina Skroumpelou @mandarini
- oniani1

This PR was created automatically.

Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
mandarini pushed a commit to supabase/supabase that referenced this pull request Apr 20, 2026
This PR updates @supabase/*-js libraries to version 2.104.0.

**Source**: supabase-js-stable-release

**Changes**:
- Updated @supabase/supabase-js to 2.104.0
- Updated @supabase/auth-js to 2.104.0
- Updated @supabase/realtime-js to 2.104.0
- Updated @supabase/postgest-js to 2.104.0
- Refreshed pnpm-lock.yaml

---

## Release Notes

## v2.104.0

## 2.104.0 (2026-04-20)

### 🚀 Features

- **storage:** extract shared header normalization utility
([#2251](supabase/supabase-js#2251))

### ❤️ Thank You

- Katerina Skroumpelou @mandarini
## v2.103.3

## 2.103.3 (2026-04-16)

### 🩹 Fixes

- **realtime:** throw Error objects instead of bare strings
([#2256](supabase/supabase-js#2256))
- **storage:** correct signedUrl type to allow null in createSignedUrls
([#2254](supabase/supabase-js#2254))

### ❤️ Thank You

- Katerina Skroumpelou @mandarini
- oniani1

This PR was created automatically.

Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
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.

Realtime throws bare strings instead of Error objects in 3 locations

2 participants