Skip to content

Commit 445dad3

Browse files
authored
feat: bump realtime-js to 2.15.1 (#1529)
1 parent 7876a24 commit 445dad3

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,6 @@ docs/v2
110110
test/*/package-lock.json
111111
test/integration/*/package-lock.json
112112

113-
.cursor/
113+
.cursor/
114+
115+
deno.lock

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@supabase/functions-js": "2.4.5",
5555
"@supabase/node-fetch": "2.6.15",
5656
"@supabase/postgrest-js": "1.19.4",
57-
"@supabase/realtime-js": "2.15.0",
57+
"@supabase/realtime-js": "2.15.1",
5858
"@supabase/storage-js": "^2.10.4"
5959
},
6060
"devDependencies": {

test/integration.test.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ const SUPABASE_URL = 'http://127.0.0.1:54321'
77
const ANON_KEY =
88
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
99

10+
// For Node.js < 22, we need to provide a WebSocket implementation
11+
// Node.js 22+ has native WebSocket support
12+
let wsTransport: any = undefined
13+
if (typeof WebSocket === 'undefined' && typeof process !== 'undefined' && process.versions?.node) {
14+
try {
15+
wsTransport = require('ws')
16+
} catch (error) {
17+
console.warn('WebSocket not available, Realtime features may not work')
18+
}
19+
}
20+
1021
const supabase = createClient(SUPABASE_URL, ANON_KEY, {
11-
realtime: { heartbeatIntervalMs: 500 },
22+
realtime: {
23+
heartbeatIntervalMs: 500,
24+
...(wsTransport && { transport: wsTransport }),
25+
},
1226
})
1327

1428
describe('Supabase Integration Tests', () => {
@@ -315,7 +329,10 @@ describe('Storage API', () => {
315329
// use service_role key for bypass RLS
316330
const SERVICE_ROLE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY || 'use-service-role-key'
317331
const supabaseWithServiceRole = createClient(SUPABASE_URL, SERVICE_ROLE_KEY, {
318-
realtime: { heartbeatIntervalMs: 500 },
332+
realtime: {
333+
heartbeatIntervalMs: 500,
334+
...(wsTransport && { transport: wsTransport }),
335+
},
319336
})
320337

321338
test('upload and list file in bucket', async () => {

0 commit comments

Comments
 (0)