π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix incorrect utf8 cache encoding for magic cache too
laurenspriem2efc645c31b0
diff --git a/mobile/lib/services/magic_cache_service.dart b/mobile/lib/services/magic_cache_service.dartindex 9bda19a98f..462cb851fd 100644--- a/mobile/lib/services/magic_cache_service.dart+++ b/mobile/lib/services/magic_cache_service.dart@@ -305,8 +305,15 @@ class MagicCacheService {_logger.info("No magic cache found");return [];}- final jsonString = file.readAsStringSync();- return MagicCache.decodeJsonToList(jsonString);+ try {+ final bytes = await file.readAsBytes();+ final jsonString = String.fromCharCodes(bytes);+ return MagicCache.decodeJsonToList(jsonString);+ } catch (e, s) {+ _logger.severe("Error reading or decoding cache file", e, s);+ await file.delete();+ rethrow;+ }}Future<void> clearMagicCache() async {