π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Avoid retrying of local thumbnail fetch if ThumbnailWidget is not mounted
ashilkn1b45dfee0e22
diff --git a/mobile/lib/ui/viewer/file/thumbnail_widget.dart b/mobile/lib/ui/viewer/file/thumbnail_widget.dartindex e5f74d0d59..298b7e1d6a 100644--- a/mobile/lib/ui/viewer/file/thumbnail_widget.dart+++ b/mobile/lib/ui/viewer/file/thumbnail_widget.dart@@ -314,7 +314,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {int retryAttempts = 0;while (retryAttempts <= _maxLocalThumbnailRetries) {try {- return _getLocalThumbnailUsingHeapPriorityQueue();+ return await _getLocalThumbnailUsingHeapPriorityQueue();} catch (e) {// only retry for specific exceptionsif (e is! TaskQueueTimeoutException &&@@ -322,6 +322,10 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {e is! TaskQueueCancelledException) {rethrow;}+ //Do not retry if the widget is not mounted+ if (!mounted) {+ return null;+ }retryAttempts++;final backoff = Duration(@@ -329,7 +333,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {);if (retryAttempts <= _maxLocalThumbnailRetries) {_logger.warning(- "Error getting local thumbnail for ${widget.file.displayName}, retrying (attempt $retryAttempts) in $backoff ms",+ "Error getting local thumbnail for ${widget.file.displayName}, retrying (attempt $retryAttempts) in ${backoff.inMilliseconds} ms",e,);await Future.delayed(backoff); // Exponential backoffdiff --git a/mobile/pubspec.lock b/mobile/pubspec.lockindex 4a250806c1..27457b51b2 100644--- a/mobile/pubspec.lock+++ b/mobile/pubspec.lock@@ -981,6 +981,14 @@ packages:url: "https://pub.dev"source: hostedversion: "2.4.4"+ flutter_password_strength:+ dependency: "direct main"+ description:+ name: flutter_password_strength+ sha256: "271b32c4003d7227e5a71d0303af0144e91a104b522da1a8d092b7847ebfee12"+ url: "https://pub.dev"+ source: hosted+ version: "0.1.6"flutter_plugin_android_lifecycle:dependency: transitivedescription: