Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: Disable sending the Lock error to Sentry (#39999)

Ivan Vasilov3e8baa2236ef
diff --git a/apps/docs/lib/userAuth.ts b/apps/docs/lib/userAuth.ts
index 973c5eb8bb1..12fec885fe7 100644
--- a/apps/docs/lib/userAuth.ts
+++ b/apps/docs/lib/userAuth.ts
@@ -1,11 +1,6 @@
-import * as Sentry from '@sentry/nextjs'
-import { gotrueClient, setCaptureException } from 'common'
+import { gotrueClient } from 'common'
import { useEffect } from 'react'
-setCaptureException((e: any) => {
- Sentry.captureException(e)
-})
-
export const auth = gotrueClient
export async function getAccessToken() {
diff --git a/apps/studio/lib/gotrue.ts b/apps/studio/lib/gotrue.ts
index ab350710682..b51fdd29e71 100644
--- a/apps/studio/lib/gotrue.ts
+++ b/apps/studio/lib/gotrue.ts
@@ -1,11 +1,6 @@
-import * as Sentry from '@sentry/nextjs'
import type { JwtPayload } from '@supabase/supabase-js'
import { getAccessToken, type User } from 'common/auth'
-import { gotrueClient, setCaptureException } from 'common/gotrue'
-
-setCaptureException((e: any) => {
- Sentry.captureException(e)
-})
+import { gotrueClient } from 'common/gotrue'
export const auth = gotrueClient
export { getAccessToken }
diff --git a/packages/common/gotrue.ts b/packages/common/gotrue.ts
index 7a241cf4ce1..d2e4ef08941 100644
--- a/packages/common/gotrue.ts
+++ b/packages/common/gotrue.ts
@@ -115,6 +115,9 @@ const logIndexedDB = (message: string, ...args: any[]) => {
})()
}
+/**
+ * Reference to a function that captures exceptions for debugging purposes to be sent to Sentry.
+ */
let captureException: ((e: any) => any) | null = null
export function setCaptureException(fn: typeof captureException) {