TF-4136 Move Sentry duplication guard, but keep interceptor ordering last (not first)
This commit is contained in:
@@ -103,7 +103,12 @@ class NetworkBindings extends Bindings {
|
||||
dio.interceptors.add(LogInterceptor(requestBody: true));
|
||||
}
|
||||
if (SentryManager.instance.isSentryAvailable) {
|
||||
dio.addSentry();
|
||||
// Guard against duplicate Sentry interceptor registration
|
||||
final alreadyHasSentry = dio.interceptors
|
||||
.any((i) => i.runtimeType.toString().contains('Sentry'));
|
||||
if (!alreadyHasSentry) {
|
||||
dio.addSentry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,12 @@ class NetworkIsolateBindings extends Bindings {
|
||||
dio.interceptors.add(LogInterceptor(requestBody: true));
|
||||
}
|
||||
if (SentryManager.instance.isSentryAvailable) {
|
||||
dio.addSentry();
|
||||
// Guard against duplicate Sentry interceptor registration
|
||||
final alreadyHasSentry = dio.interceptors
|
||||
.any((i) => i.runtimeType.toString().contains('Sentry'));
|
||||
if (!alreadyHasSentry) {
|
||||
dio.addSentry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user