From 7825490b0fe45c0f0690ffb3a07ea20b63b57f88 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Fri, 6 Mar 2026 18:30:47 +0100 Subject: [PATCH] fix: filter Windows file-lock cache manager errors from Sentry --- lib/main.dart | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index fc02657e..3ddef8c0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -173,8 +173,20 @@ FutureOr _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 with WidgetsBindingObserver { downloadProvider: context.read(), ), update: (_, syncService, downloadProvider, previous) { - return previous ?? - OfflineWatchProvider( - syncService: syncService, - downloadProvider: downloadProvider, - ); + return previous ?? OfflineWatchProvider(syncService: syncService, downloadProvider: downloadProvider); }, ), // Existing providers