From 456f27e02e70866b2ae5536e3f1f540a55d4a405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Caba=C3=A7o?= Date: Wed, 27 Nov 2024 23:45:22 +0000 Subject: [PATCH 1/6] fix: bump up realtime-js (#1318) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99851b822..cad4df747 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.7", + "@supabase/realtime-js": "2.10.9", "@supabase/storage-js": "2.7.1" }, "devDependencies": { @@ -1204,14 +1204,14 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.10.7", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.7.tgz", - "integrity": "sha512-OLI0hiSAqQSqRpGMTUwoIWo51eUivSYlaNBgxsXZE7PSoWh12wPRdVt0psUMaUzEonSB85K21wGc7W5jHnT6uA==", + "version": "2.10.9", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.9.tgz", + "integrity": "sha512-0AjN65VDNIScZzrrPaVvlND4vbgVS+j9Wcy3zf7e+l9JY4IwCTahFenPLcKy9bkr7KY0wfB7MkipZPKxMaDnjw==", "dependencies": { "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", "@types/ws": "^8.5.10", - "ws": "^8.14.2" + "ws": "^8.18.0" } }, "node_modules/@supabase/storage-js": { @@ -8072,9 +8072,9 @@ } }, "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, diff --git a/package.json b/package.json index fb375584e..c735a54be 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.7", + "@supabase/realtime-js": "2.10.9", "@supabase/storage-js": "2.7.1" }, "devDependencies": { From 88a44dfbfdf336f616bfd59a3137a35afc88b0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Caba=C3=A7o?= Date: Thu, 5 Dec 2024 15:00:21 +0000 Subject: [PATCH 2/6] feat: Realtime using accessToken callback for auth (#1320) --- package-lock.json | 8 ++++---- package.json | 2 +- src/SupabaseClient.ts | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index cad4df747..f70e7e9d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.9", + "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" }, "devDependencies": { @@ -1204,9 +1204,9 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.10.9", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.9.tgz", - "integrity": "sha512-0AjN65VDNIScZzrrPaVvlND4vbgVS+j9Wcy3zf7e+l9JY4IwCTahFenPLcKy9bkr7KY0wfB7MkipZPKxMaDnjw==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.2.tgz", + "integrity": "sha512-u/XeuL2Y0QEhXSoIPZZwR6wMXgB+RQbJzG9VErA3VghVt7uRfSVsjeqd7m5GhX3JR6dM/WRmLbVR8URpDWG4+w==", "dependencies": { "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", diff --git a/package.json b/package.json index c735a54be..d1d9ff74d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.9", + "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" }, "devDependencies": { diff --git a/src/SupabaseClient.ts b/src/SupabaseClient.ts index 9f0a32c73..e15a61c4b 100644 --- a/src/SupabaseClient.ts +++ b/src/SupabaseClient.ts @@ -118,7 +118,11 @@ export default class SupabaseClient< this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch) - this.realtime = this._initRealtimeClient({ headers: this.headers, ...settings.realtime }) + this.realtime = this._initRealtimeClient({ + headers: this.headers, + accessToken: this._getAccessToken, + ...settings.realtime, + }) this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, { headers: this.headers, schema: settings.db.schema, @@ -330,9 +334,6 @@ export default class SupabaseClient< (event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') && this.changedAccessToken !== token ) { - // Token has changed - this.realtime.setAuth(token ?? null) - this.changedAccessToken = token } else if (event === 'SIGNED_OUT') { // Token is removed From b9c86f503e04cf92083d15a82746c6ee272840c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Caba=C3=A7o?= Date: Thu, 5 Dec 2024 22:14:26 +0000 Subject: [PATCH 3/6] Revert "feat: Realtime using accessToken callback for auth (#1320)" (#1323) This reverts commit 88a44dfbfdf336f616bfd59a3137a35afc88b0dc. --- package-lock.json | 8 ++++---- package.json | 2 +- src/SupabaseClient.ts | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index f70e7e9d6..cad4df747 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.11.2", + "@supabase/realtime-js": "2.10.9", "@supabase/storage-js": "2.7.1" }, "devDependencies": { @@ -1204,9 +1204,9 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.11.2", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.2.tgz", - "integrity": "sha512-u/XeuL2Y0QEhXSoIPZZwR6wMXgB+RQbJzG9VErA3VghVt7uRfSVsjeqd7m5GhX3JR6dM/WRmLbVR8URpDWG4+w==", + "version": "2.10.9", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.9.tgz", + "integrity": "sha512-0AjN65VDNIScZzrrPaVvlND4vbgVS+j9Wcy3zf7e+l9JY4IwCTahFenPLcKy9bkr7KY0wfB7MkipZPKxMaDnjw==", "dependencies": { "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", diff --git a/package.json b/package.json index d1d9ff74d..c735a54be 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.11.2", + "@supabase/realtime-js": "2.10.9", "@supabase/storage-js": "2.7.1" }, "devDependencies": { diff --git a/src/SupabaseClient.ts b/src/SupabaseClient.ts index e15a61c4b..9f0a32c73 100644 --- a/src/SupabaseClient.ts +++ b/src/SupabaseClient.ts @@ -118,11 +118,7 @@ export default class SupabaseClient< this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch) - this.realtime = this._initRealtimeClient({ - headers: this.headers, - accessToken: this._getAccessToken, - ...settings.realtime, - }) + this.realtime = this._initRealtimeClient({ headers: this.headers, ...settings.realtime }) this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, { headers: this.headers, schema: settings.db.schema, @@ -334,6 +330,9 @@ export default class SupabaseClient< (event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') && this.changedAccessToken !== token ) { + // Token has changed + this.realtime.setAuth(token ?? null) + this.changedAccessToken = token } else if (event === 'SIGNED_OUT') { // Token is removed From 0ea6d8f2c7455223f4be249884682d7e8a801a13 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Fri, 6 Dec 2024 18:40:58 +0800 Subject: [PATCH 4/6] fix: bump auth-js to v2.66.1 (#1325) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cad4df747..25f17abf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-automated", "license": "MIT", "dependencies": { - "@supabase/auth-js": "2.65.1", + "@supabase/auth-js": "2.66.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", @@ -1169,9 +1169,9 @@ } }, "node_modules/@supabase/auth-js": { - "version": "2.65.1", - "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.65.1.tgz", - "integrity": "sha512-IA7i2Xq2SWNCNMKxwmPlHafBQda0qtnFr8QnyyBr+KaSxoXXqEzFCnQ1dGTy6bsZjVBgXu++o3qrDypTspaAPw==", + "version": "2.66.1", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.66.1.tgz", + "integrity": "sha512-kOW+04SuDXmP2jRX9JL1Rgzduj8BcOG1qC3RaWdZsxnv89svNCdLRv8PfXW3QPKJdw0k1jF30OlQDPkzbDEL9w==", "dependencies": { "@supabase/node-fetch": "^2.6.14" } diff --git a/package.json b/package.json index c735a54be..5bd61770c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "serve:coverage": "npm run test:coverage && serve test/coverage" }, "dependencies": { - "@supabase/auth-js": "2.65.1", + "@supabase/auth-js": "2.66.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", From 325c2c9b253a81cf1f02ec7e2bdbced7318467f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Caba=C3=A7o?= Date: Mon, 9 Dec 2024 12:45:44 +0000 Subject: [PATCH 5/6] fix: Bind proper object to setAuth on Realtime callback (#1324) --- package-lock.json | 8 ++++---- package.json | 2 +- src/SupabaseClient.ts | 13 ++++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25f17abf2..35227e46c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.9", + "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" }, "devDependencies": { @@ -1204,9 +1204,9 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.10.9", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.9.tgz", - "integrity": "sha512-0AjN65VDNIScZzrrPaVvlND4vbgVS+j9Wcy3zf7e+l9JY4IwCTahFenPLcKy9bkr7KY0wfB7MkipZPKxMaDnjw==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.2.tgz", + "integrity": "sha512-u/XeuL2Y0QEhXSoIPZZwR6wMXgB+RQbJzG9VErA3VghVt7uRfSVsjeqd7m5GhX3JR6dM/WRmLbVR8URpDWG4+w==", "dependencies": { "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", diff --git a/package.json b/package.json index 5bd61770c..7bb430fd0 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.16.3", - "@supabase/realtime-js": "2.10.9", + "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" }, "devDependencies": { diff --git a/src/SupabaseClient.ts b/src/SupabaseClient.ts index 9f0a32c73..5058edf55 100644 --- a/src/SupabaseClient.ts +++ b/src/SupabaseClient.ts @@ -117,8 +117,11 @@ export default class SupabaseClient< } this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch) - - this.realtime = this._initRealtimeClient({ headers: this.headers, ...settings.realtime }) + this.realtime = this._initRealtimeClient({ + headers: this.headers, + accessToken: this._getAccessToken.bind(this), + ...settings.realtime, + }) this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, { headers: this.headers, schema: settings.db.schema, @@ -330,13 +333,9 @@ export default class SupabaseClient< (event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') && this.changedAccessToken !== token ) { - // Token has changed - this.realtime.setAuth(token ?? null) - this.changedAccessToken = token } else if (event === 'SIGNED_OUT') { - // Token is removed - this.realtime.setAuth(this.supabaseKey) + this.realtime.setAuth() if (source == 'STORAGE') this.auth.signOut() this.changedAccessToken = undefined } From e74067ce7c5eea68b60a7cf5bd54649ad41db1e7 Mon Sep 17 00:00:00 2001 From: avallete Date: Mon, 9 Dec 2024 14:49:22 +0100 Subject: [PATCH 6/6] chore: upgrade latest postgres-js --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c73e6947..92904d651 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@supabase/auth-js": "2.66.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", - "@supabase/postgrest-js": "1.17.5", + "@supabase/postgrest-js": "1.17.7", "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" }, @@ -1196,9 +1196,9 @@ } }, "node_modules/@supabase/postgrest-js": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.17.5.tgz", - "integrity": "sha512-dq04qmKQoz5vH/sfBYvYJSyaNcYzdEkhl01qCFHhmr1c0CwLyVVOpUbfO+viUCBqvA04XrIwzSSp2oR+nBY9+Q==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.17.7.tgz", + "integrity": "sha512-aOzOYaTADm/dVTNksyqv9KsbhVa1gHz1Hoxb2ZEF2Ed9H7qlWOfptECQWmkEmrrFjtNaiPrgiSaPECvzI/seDA==", "license": "MIT", "dependencies": { "@supabase/node-fetch": "^2.6.14" diff --git a/package.json b/package.json index da0af60b8..0b367c578 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@supabase/auth-js": "2.66.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", - "@supabase/postgrest-js": "1.17.5", + "@supabase/postgrest-js": "1.17.7", "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" },