Skip to content

Commit

Permalink
Sentry: Fix broken configureScope() call
Browse files Browse the repository at this point in the history
`configureScope()` has apparently been deprecated a while ago and was recently removed in getsentry/sentry-javascript#9887. Since we are mocking Sentry in our test suite we unfortunately didn't notice the issue before it popped up on our staging environment.
  • Loading branch information
Turbo87 committed May 14, 2024
1 parent 271af2e commit 4266cc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ApplicationRoute extends Route {
setSentryTransaction(transition) {
let name = transition.to?.name;
if (name) {
this.sentry.configureScope(scope => scope.setTransactionName(name));
this.sentry.getCurrentScope().setTransactionName(name);
}
}
}
4 changes: 2 additions & 2 deletions app/services/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default class SentryService extends Service {
Sentry.captureException(error, captureContext);
}

configureScope(callback) {
Sentry.configureScope(callback);
getCurrentScope() {
return Sentry.getCurrentScope();
}

setUser(user) {
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class MockSentryService extends Service {
this.events.push(event);
}

configureScope(callback) {
callback(this.scope);
getCurrentScope() {
return this.scope;
}

setUser(user) {
Expand Down

0 comments on commit 4266cc9

Please sign in to comment.