Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Check lock again before reporting file

Neeraj Gupta840fc3c061ab
diff --git a/mobile/lib/core/errors.dart b/mobile/lib/core/errors.dart
index b6d16802c3..0c0d16949a 100644
--- a/mobile/lib/core/errors.dart
+++ b/mobile/lib/core/errors.dart
@@ -58,6 +58,8 @@ bool isHandledSyncError(Object errObj) {
class LockAlreadyAcquiredError extends Error {}
+class LockFreedError extends Error{}
+
class UnauthorizedError extends Error {}
class RequestCancelledError extends Error {}
diff --git a/mobile/lib/utils/file_uploader.dart b/mobile/lib/utils/file_uploader.dart
index bcef6f4c86..98c9d49fc2 100644
--- a/mobile/lib/utils/file_uploader.dart
+++ b/mobile/lib/utils/file_uploader.dart
@@ -751,6 +751,11 @@ class FileUploader {
if (SyncService.instance.shouldStopSync()) {
throw SyncStopRequestedError();
}
+ final stillLocked = await _uploadLocks.isLocked(lockKey, _processType.toString());
+ if (!stillLocked) {
+ _logger.warning('file ${file.tag} report paused is missing');
+ throw LockFreedError();
+ }
EnteFile remoteFile;
if (isUpdatedFile) {