Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob]Ignore souceFileMissing error for iOS (#1273)

Neeraj Gupta548721e41575
diff --git a/mobile/lib/generated/intl/messages_pt.dart b/mobile/lib/generated/intl/messages_pt.dart
index dd169df420..71de452972 100644
--- a/mobile/lib/generated/intl/messages_pt.dart
+++ b/mobile/lib/generated/intl/messages_pt.dart
@@ -766,6 +766,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Não rastreamos instalações do aplicativo. Seria útil se você nos contasse onde nos encontrou!"),
"hearUsWhereTitle": MessageLookupByLibrary.simpleMessage(
"Como você ouviu sobre o Ente? (opcional)"),
+ "help": MessageLookupByLibrary.simpleMessage("Ajuda"),
"hidden": MessageLookupByLibrary.simpleMessage("Oculto"),
"hide": MessageLookupByLibrary.simpleMessage("Ocultar"),
"hiding": MessageLookupByLibrary.simpleMessage("Ocultando..."),
@@ -1011,6 +1012,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Detalhes de pagamento"),
"paymentFailed":
MessageLookupByLibrary.simpleMessage("Falha no pagamento"),
+ "paymentFailedMessage": MessageLookupByLibrary.simpleMessage(
+ "Infelizmente o seu pagamento falhou. Entre em contato com o suporte e nós ajudaremos você!"),
"paymentFailedTalkToProvider": m37,
"pendingItems": MessageLookupByLibrary.simpleMessage("Itens pendentes"),
"pendingSync":
diff --git a/mobile/lib/generated/intl/messages_zh.dart b/mobile/lib/generated/intl/messages_zh.dart
index c55f004a00..c611a7352d 100644
--- a/mobile/lib/generated/intl/messages_zh.dart
+++ b/mobile/lib/generated/intl/messages_zh.dart
@@ -630,6 +630,7 @@ class MessageLookup extends MessageLookupByLibrary {
"我们不跟踪应用程序安装情况。如果您告诉我们您是在哪里找到我们的,将会有所帮助!"),
"hearUsWhereTitle":
MessageLookupByLibrary.simpleMessage("您是如何知道Ente的? (可选的)"),
+ "help": MessageLookupByLibrary.simpleMessage("帮助"),
"hidden": MessageLookupByLibrary.simpleMessage("已隐藏"),
"hide": MessageLookupByLibrary.simpleMessage("隐藏"),
"hiding": MessageLookupByLibrary.simpleMessage("正在隐藏..."),
@@ -834,6 +835,8 @@ class MessageLookup extends MessageLookupByLibrary {
"我们不储存这个密码,所以如果忘记, <underline>我们将无法解密您的数据</underline>"),
"paymentDetails": MessageLookupByLibrary.simpleMessage("付款明细"),
"paymentFailed": MessageLookupByLibrary.simpleMessage("支付失败"),
+ "paymentFailedMessage": MessageLookupByLibrary.simpleMessage(
+ "不幸的是,您的付款失败。请联系支持人员,我们将为您提供帮助!"),
"paymentFailedTalkToProvider": m37,
"pendingItems": MessageLookupByLibrary.simpleMessage("待处理项目"),
"pendingSync": MessageLookupByLibrary.simpleMessage("正在等待同步"),
diff --git a/mobile/lib/services/ignored_files_service.dart b/mobile/lib/services/ignored_files_service.dart
index 759acd157d..d4a4af9f9b 100644
--- a/mobile/lib/services/ignored_files_service.dart
+++ b/mobile/lib/services/ignored_files_service.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'package:logging/logging.dart';
+import "package:photos/core/errors.dart";
import 'package:photos/db/ignored_files_db.dart';
import 'package:photos/models/file/file.dart';
import 'package:photos/models/ignored_file.dart';
@@ -47,7 +48,10 @@ class IgnoredFilesService {
return false;
}
- String? getUploadSkipReason(Map<String, String> idToReasonMap, EnteFile file) {
+ String? getUploadSkipReason(
+ Map<String, String> idToReasonMap,
+ EnteFile file,
+ ) {
final id = _getIgnoreID(file.localID, file.deviceFolder, file.title);
if (id != null && id.isNotEmpty) {
return idToReasonMap[id];
@@ -100,6 +104,12 @@ class IgnoredFilesService {
for (IgnoredFile iFile in dbResult) {
final id = _idForIgnoredFile(iFile);
if (id != null) {
+ if (Platform.isIOS &&
+ iFile.reason == InvalidReason.sourceFileMissing.name) {
+ // ignoreSourceFileMissing error on iOS as the file fetch from iCloud might have failed,
+ // but the file might be available later
+ continue;
+ }
result[id] = iFile.reason;
}
}
diff --git a/mobile/lib/services/local_sync_service.dart b/mobile/lib/services/local_sync_service.dart
index 858a98c6e6..38a258452f 100644
--- a/mobile/lib/services/local_sync_service.dart
+++ b/mobile/lib/services/local_sync_service.dart
@@ -220,6 +220,11 @@ class LocalSyncService {
_logger.warning('Invalid file received for ignoring: $file');
return;
}
+ if (Platform.isIOS && error.reason == InvalidReason.sourceFileMissing) {
+ // ignoreSourceFileMissing error on iOS as the file fetch from iCloud might have failed,
+ // but the file might be available later
+ return;
+ }
final ignored = IgnoredFile(
file.localID,
file.title,