mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
Reinstate captureException in SessionTimeoutModal with lowered quota usage (#37925)
This commit is contained in:
1 parent
7a35ad3081
commit
abf62572a4
2 files changed
+14
-1
No files matched your search
@@ -1,3 +1,6 @@
|
||||
import * as Sentry from '@sentry/nextjs'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
import { InlineLink } from 'components/ui/InlineLink'
|
||||
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
|
||||
|
||||
@@ -12,6 +15,12 @@ export const SessionTimeoutModal = ({
|
||||
onClose,
|
||||
redirectToSignIn,
|
||||
}: SessionTimeoutModalProps) => {
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
Sentry.captureException(new Error('Session error detected'))
|
||||
}
|
||||
}, [visible])
|
||||
|
||||
return (
|
||||
<ConfirmationModal
|
||||
visible={visible}
|
||||
|
||||
@@ -63,8 +63,12 @@ Sentry.init({
|
||||
const isInvalidUrlEvent = (hint.originalException as any)?.message?.includes(
|
||||
`Failed to construct 'URL': Invalid URL`
|
||||
)
|
||||
// [Joshen] Similar behaviour for this error from SessionTimeoutModal to control the quota usage
|
||||
const isSessionTimeoutEvent = (hint.originalException as any)?.message.includes(
|
||||
'Session error detected'
|
||||
)
|
||||
|
||||
if (isInvalidUrlEvent && Math.random() > 0.01) {
|
||||
if ((isInvalidUrlEvent || isSessionTimeoutEvent) && Math.random() > 0.01) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user