fix: filter Windows file-lock cache manager errors from Sentry

This commit is contained in:
edde746
2026-03-06 18:30:47 +01:00
parent c06b0efedc
commit 7825490b0f
+14 -6
View File
@@ -173,8 +173,20 @@ FutureOr<SentryEvent?> _beforeSend(SentryEvent event, Hint _) {
final instance = SettingsService.instanceOrNull;
if (instance != null && !instance.getCrashReporting()) return null;
// Scrub Plex tokens and server URLs from exception messages
// Drop harmless Windows file-lock errors from cache manager cleanup
var exceptions = event.exceptions;
if (exceptions != null &&
exceptions.any(
(e) =>
e.type == 'FileSystemException' &&
e.value != null &&
e.value!.contains('plexImageCache') &&
e.value!.contains('errno = 32'),
)) {
return null;
}
// Scrub Plex tokens and server URLs from exception messages
if (exceptions != null) {
exceptions = exceptions.map((e) {
final value = e.value;
@@ -362,11 +374,7 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
downloadProvider: context.read<DownloadProvider>(),
),
update: (_, syncService, downloadProvider, previous) {
return previous ??
OfflineWatchProvider(
syncService: syncService,
downloadProvider: downloadProvider,
);
return previous ?? OfflineWatchProvider(syncService: syncService, downloadProvider: downloadProvider);
},
),
// Existing providers