Skip to content

Commit

Permalink
Bump @sentry/react from 7.113.0 to 8.38.0 (#1402)
Browse files Browse the repository at this point in the history
* Bump @sentry/react from 7.113.0 to 8.38.0

Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 7.113.0 to 8.38.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@7.113.0...8.38.0)

---
updated-dependencies:
- dependency-name: "@sentry/react"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fikser oppsett i Sentry etter major versjonsbump

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hanne Olsen <[email protected]>
  • Loading branch information
dependabot[bot] and hanneolsen authored Nov 14, 2024
1 parent 650a0f0 commit d13aa6a
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 160 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"@portabletext/react": "^3.0.7",
"@portabletext/toolkit": "^2.0.8",
"@sanity/client": "^6.18.2",
"@sentry/react": "^7.113.0",
"@sentry/react": "^8.38.0",
"amplitude-js": "^8.21.9",
"axios": "^1.7.4",
"compression": "^1.7.4",
Expand Down Expand Up @@ -138,7 +138,7 @@
"@babel/preset-typescript": "^7.24.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@portabletext/types": "^2.0.6",
"@sentry/webpack-plugin": "^2.18.0",
"@sentry/webpack-plugin": "^2.22.6",
"@testing-library/dom": "^10.3.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^16.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/utils/sentry.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Event } from '@sentry/react';
import { ErrorEvent } from '@sentry/react';
import { mockDeep, mockFn } from 'jest-mock-extended';

import { fjernPersonopplysninger } from './sentry';

describe('sentry', () => {
it('filtrerer fødselsnummer', () => {
const breadcrumbData = { fnr: '123456 78901' };
const event = mockDeep<Event>({
const event = mockDeep<ErrorEvent>({
message: '12345678901',
breadcrumbs: [
{
Expand Down
8 changes: 5 additions & 3 deletions src/frontend/utils/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Sentry from '@sentry/react';
import { Breadcrumb, Event, EventHint } from '@sentry/react';

const environment = window.location.hostname;

Expand All @@ -11,7 +10,10 @@ const maskeringsregler = [
];

// Exportes kun for å kunne testes
export const fjernPersonopplysninger = (event: Event, _hint?: EventHint): Event => {
export const fjernPersonopplysninger = (
event: Sentry.ErrorEvent,
_hint?: Sentry.EventHint
): Sentry.ErrorEvent => {
const url = event.request?.url ? maskerPersonopplysninger(event.request.url) : '';
return {
...event,
Expand All @@ -25,7 +27,7 @@ export const fjernPersonopplysninger = (event: Event, _hint?: EventHint): Event
},
data: maskerPersonoppysningerIObjekt(event.request?.data),
},
breadcrumbs: (event.breadcrumbs || []).map((breadcrumb: Breadcrumb) => ({
breadcrumbs: (event.breadcrumbs || []).map((breadcrumb: Sentry.Breadcrumb) => ({
...breadcrumb,
event_id: maskerPersonopplysninger(event.event_id),
message: maskerPersonopplysninger(breadcrumb.message),
Expand Down
Loading

0 comments on commit d13aa6a

Please sign in to comment.