File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
components/interfaces/SignIn Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ import * as Sentry from '@sentry/nextjs'
2+ import { useEffect } from 'react'
3+
14import { InlineLink } from 'components/ui/InlineLink'
25import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
36
@@ -12,6 +15,12 @@ export const SessionTimeoutModal = ({
1215 onClose,
1316 redirectToSignIn,
1417} : SessionTimeoutModalProps ) => {
18+ useEffect ( ( ) => {
19+ if ( visible ) {
20+ Sentry . captureException ( new Error ( 'Session error detected' ) )
21+ }
22+ } , [ visible ] )
23+
1524 return (
1625 < ConfirmationModal
1726 visible = { visible }
Original file line number Diff line number Diff line change @@ -63,8 +63,12 @@ Sentry.init({
6363 const isInvalidUrlEvent = ( hint . originalException as any ) ?. message ?. includes (
6464 `Failed to construct 'URL': Invalid URL`
6565 )
66+ // [Joshen] Similar behaviour for this error from SessionTimeoutModal to control the quota usage
67+ const isSessionTimeoutEvent = ( hint . originalException as any ) ?. message . includes (
68+ 'Session error detected'
69+ )
6670
67- if ( isInvalidUrlEvent && Math . random ( ) > 0.01 ) {
71+ if ( ( isInvalidUrlEvent || isSessionTimeoutEvent ) && Math . random ( ) > 0.01 ) {
6872 return null
6973 }
7074
You can’t perform that action at this time.
0 commit comments