TF-4136 Move Sentry duplication guard, but keep interceptor ordering last (not first)

This commit is contained in:
dab246
2026-01-12 10:04:33 +07:00
committed by Dat H. Pham
parent 1514136f39
commit 944029d16c
7 changed files with 27 additions and 7 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class ApplicationManager {
log('ApplicationManager:getAppVersion -> cached: $version');
return version;
} catch (e) {
logWarning('ApplicationManager:getAppVersion failedd, Exception = $e');
logWarning('ApplicationManager:getAppVersion failed, Exception = $e');
return '';
}
}
@@ -10,6 +10,10 @@ class SentryInitializer {
'set-cookie',
'x-auth',
'x-token',
'api-key',
'apikey',
'secret',
'bearer',
];
static Future<bool> init(FutureOr<void> Function() appRunner) async {
@@ -63,6 +67,8 @@ class SentryInitializer {
data: null,
);
// Note: The copyWith method is deprecated,
// so values must be assigned directly to the instance.
return SentryEvent(
eventId: event.eventId,
contexts: event.contexts,
@@ -20,6 +20,10 @@ class SentryManager {
required FutureOr<void> Function() fallBackRunner,
}) async {
try {
if (_isSentryAvailable) {
log('[SentryManager] Already initialized, skipping');
return;
}
_isSentryAvailable = await SentryInitializer.init(appRunner);
log('[SentryManager] Sentry initialized: $_isSentryAvailable');
} catch (e, st) {