Skip to content

Commit 2e41eb5

Browse files
authored
Sentry: Fix broken configureScope() call (#8643)
`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.
1 parent 271af2e commit 2e41eb5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/routes/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default class ApplicationRoute extends Route {
7777
setSentryTransaction(transition) {
7878
let name = transition.to?.name;
7979
if (name) {
80-
this.sentry.configureScope(scope => scope.setTransactionName(name));
80+
this.sentry.getCurrentScope().setTransactionName(name);
8181
}
8282
}
8383
}

app/services/sentry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default class SentryService extends Service {
77
Sentry.captureException(error, captureContext);
88
}
99

10-
configureScope(callback) {
11-
Sentry.configureScope(callback);
10+
getCurrentScope() {
11+
return Sentry.getCurrentScope();
1212
}
1313

1414
setUser(user) {

tests/helpers/sentry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class MockSentryService extends Service {
1111
this.events.push(event);
1212
}
1313

14-
configureScope(callback) {
15-
callback(this.scope);
14+
getCurrentScope() {
15+
return this.scope;
1616
}
1717

1818
setUser(user) {

0 commit comments

Comments
 (0)