Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:files): handle locks without scope in checkConflicts

johavenf9bcbde21ffd
diff --git a/backend/src/applications/files/services/files-lock-manager.service.ts b/backend/src/applications/files/services/files-lock-manager.service.ts
index a706dd93..de4abe66 100644
--- a/backend/src/applications/files/services/files-lock-manager.service.ts
+++ b/backend/src/applications/files/services/files-lock-manager.service.ts
@@ -179,7 +179,7 @@ export class FilesLockManager {
Returns on the first conflict (compliant with the RFC 4918)
*/
for await (const l of this.searchParentLocks(dbFile, { includeRoot: true, depth: DEPTH.INFINITY })) {
- if (options?.lockScope && options?.lockScope === LOCK_SCOPE.SHARED && l.options.lockScope === LOCK_SCOPE.SHARED && options?.app === l.app) {
+ if (options?.lockScope && options?.lockScope === LOCK_SCOPE.SHARED && l.options?.lockScope === LOCK_SCOPE.SHARED && options?.app === l.app) {
// Only compatible with shared locks (with the same owner and the same application)
continue
}