Skip to content

Commit

Permalink
chore: bump apollo client and node types (#675)
Browse files Browse the repository at this point in the history
* chore: bump apollo client and node types

* chore: bump graphql-request

* chore: add sentry error helpers

* fix: sentry error handling
  • Loading branch information
agualis authored Feb 27, 2025
1 parent 4d5b451 commit 998fcab
Show file tree
Hide file tree
Showing 13 changed files with 1,007 additions and 772 deletions.
4 changes: 2 additions & 2 deletions apps/beets-frontend-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"postinstall": "npm run gen:theme-typings"
},
"dependencies": {
"@apollo/client": "^3.11.8",
"@apollo/client": "^3.13.1",
"@balancer/sdk": "2.1.3",
"@chakra-ui/hooks": "2.4.2",
"@chakra-ui/react": "2.10.4",
Expand Down Expand Up @@ -52,7 +52,7 @@
"@repo/typescript-config": "workspace:*",
"@types/js-cookie": "^3.0.6",
"@types/lodash": "^4.14.195",
"@types/node": "20.10.2",
"@types/node": "22.13.5",
"@types/react": "18.2.34",
"@types/react-dom": "18.2.6",
"@types/tinycolor2": "^1.4.6",
Expand Down
20 changes: 10 additions & 10 deletions apps/beets-frontend-v3/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as Sentry from '@sentry/nextjs'
import { sentryDSN } from './sentry.config'
import { isProd } from '@repo/lib/config/app.config'
import { shouldIgnoreException } from '@repo/lib/shared/utils/query-errors'
import { customizeEvent, shouldIgnoreException } from '@repo/lib/shared/utils/sentry.helpers'

Sentry.init({
// Change this value only if you need to debug in development (we have a custom developmentSentryDSN for that)
Expand Down Expand Up @@ -83,8 +83,7 @@ Sentry.init({
})

function handleNonFatalError(event: Sentry.ErrorEvent): Sentry.ErrorEvent | null {
const firstValue = getFirstExceptionValue(event)
if (firstValue && shouldIgnoreException(firstValue)) return null
if (shouldIgnoreException(event)) return null
event.level = 'error'
return event
}
Expand All @@ -96,19 +95,20 @@ function handleFatalError(
event.level = 'fatal'

if (event?.exception?.values?.length) {
const firstValue = event.exception.values[0]
const lastIndex = event.exception.values.length - 1
const topValue = event.exception.values[lastIndex]

if (shouldIgnoreException(firstValue)) return null
if (shouldIgnoreException(event)) return null

const flowType = uppercaseSegment(criticalFlowPath)
firstValue.value = `Unexpected error in ${flowType} flow.
Cause: ${firstValue.type}: ${firstValue.value}`
topValue.value = `Unexpected error in ${flowType} flow.
Cause: ${topValue.type}: ${topValue.value}`

firstValue.type = flowType + 'Error'
event.exception.values[0] = firstValue
topValue.type = flowType + 'Error'
event.exception.values[lastIndex] = topValue
}

return event
return customizeEvent(event)
}

function uppercaseSegment(path: string): string {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@repo/typescript-config": "workspace:*",
"@types/js-cookie": "^3.0.6",
"@types/lodash": "^4.14.195",
"@types/node": "20.10.2",
"@types/node": "22.13.5",
"@types/prismjs": "^1.26.5",
"@types/react": "18.2.34",
"@types/react-dom": "18.2.6",
Expand Down
Loading

0 comments on commit 998fcab

Please sign in to comment.