Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
feat(backend:sync): expose ignore-delete path setting
johaven8fb800be71ee
diff --git a/backend/src/applications/files/services/files-favorites-queries.e2e-spec.ts b/backend/src/applications/files/services/files-favorites-queries.e2e-spec.tsindex fdca710e..49759fdc 100644--- a/backend/src/applications/files/services/files-favorites-queries.e2e-spec.ts+++ b/backend/src/applications/files/services/files-favorites-queries.e2e-spec.ts@@ -113,6 +113,7 @@ describe('Files favorites queries (e2e)', () => {remotePath: `personal/${rootName}`,permissions: '',mode: SYNC_PATH_MODE.BOTH,+ ignoreDelete: false,enabled: true,diffMode: SYNC_PATH_DIFF_MODE.FAST,conflictMode: SYNC_PATH_CONFLICT_MODE.RECENT,diff --git a/backend/src/applications/sync/dtos/sync-path.dto.ts b/backend/src/applications/sync/dtos/sync-path.dto.tsindex 9f7acecd..1e7caee5 100644--- a/backend/src/applications/sync/dtos/sync-path.dto.ts+++ b/backend/src/applications/sync/dtos/sync-path.dto.ts@@ -43,6 +43,10 @@ export class SyncPathDto implements SyncPathSettings {@IsEnum(SYNC_PATH_MODE)mode: SYNC_PATH_MODE+ @IsOptional()+ @IsBoolean()+ ignoreDelete: boolean+@Transform(({ value }) => (typeof value === 'string' ? value.toLowerCase() : value))@IsEnum(SYNC_PATH_DIFF_MODE)diffMode: SYNC_PATH_DIFF_MODEdiff --git a/backend/src/applications/sync/interfaces/sync-path.interface.ts b/backend/src/applications/sync/interfaces/sync-path.interface.tsindex d638a3c3..2a241d2f 100644--- a/backend/src/applications/sync/interfaces/sync-path.interface.ts+++ b/backend/src/applications/sync/interfaces/sync-path.interface.ts@@ -10,6 +10,7 @@ export interface SyncPathSettings {remotePath: stringpermissions: stringmode: SYNC_PATH_MODE+ ignoreDelete: booleanenabled: booleandiffMode: SYNC_PATH_DIFF_MODEconflictMode: SYNC_PATH_CONFLICT_MODEdiff --git a/backend/src/applications/sync/services/sync-paths-manager.service.spec.ts b/backend/src/applications/sync/services/sync-paths-manager.service.spec.tsindex 84243f9c..cc4b7885 100644--- a/backend/src/applications/sync/services/sync-paths-manager.service.spec.ts+++ b/backend/src/applications/sync/services/sync-paths-manager.service.spec.ts@@ -200,11 +200,25 @@ describe(SyncPathsManager.name, () => {expect(syncQueries.createPath).toHaveBeenCalledWith('client-1',{ ownerId: 1 },- expect.objectContaining({ remotePath: 'SPACES/alias/sub', permissions: 'env-perms' })+ expect.objectContaining({ remotePath: 'SPACES/alias/sub', permissions: 'env-perms', ignoreDelete: false }))getDBPropsSpy.mockRestore()})++ it('should persist ignoreDelete when explicitly enabled', async () => {+ const req = baseReq()+ vi.mocked(isPathExists).mockResolvedValue(true)+ vi.mocked(isPathIsDir).mockResolvedValue(true)+ vi.mocked(getEnvPermissions).mockReturnValue('env-perms')+ syncQueries.getClient.mockResolvedValue({ id: 'client-1' })+ vi.spyOn<any, any>(service as any, 'getDBProps').mockResolvedValue({ ownerId: 1 })+ syncQueries.createPath.mockResolvedValue(124)++ await service.createPath(req, { remotePath: 'client/remote', ignoreDelete: true } as any)++ expect(syncQueries.createPath).toHaveBeenCalledWith('client-1', { ownerId: 1 }, expect.objectContaining({ ignoreDelete: true }))+ })})describe('deletePath', () => {@@ -255,7 +269,14 @@ describe(SyncPathsManager.name, () => {it('should update path settings, set new timestamp, clear cache and return updated settings', async () => {syncQueries.clientExistsForOwner.mockResolvedValue(true)- syncQueries.getPathSettings.mockResolvedValue({ id: 5, timestamp: 500, lastSync: 1, remotePath: '/a', permissions: 'p' })+ syncQueries.getPathSettings.mockResolvedValue({+ id: 5,+ timestamp: 500,+ lastSync: 1,+ remotePath: '/a',+ permissions: 'p',+ ignoreDelete: true+ })syncQueries.updatePathSettings.mockResolvedValue(undefined)vi.mocked(currentTimeStamp).mockReturnValue(4242)@@ -263,10 +284,22 @@ describe(SyncPathsManager.name, () => {expect(syncQueries.updatePathSettings).toHaveBeenCalledWith('c1',5,- expect.objectContaining({ id: 5, lastSync: 3, timestamp: 4242, permissions: 'new' })+ expect.objectContaining({ id: 5, lastSync: 3, timestamp: 4242, permissions: 'new', ignoreDelete: true }))expect(syncQueries.clearCachePathSettings).toHaveBeenCalledWith('c1', 5)- expect(out).toEqual(expect.objectContaining({ id: 5, lastSync: 3, timestamp: 4242, permissions: 'new' }))+ expect(out).toEqual(expect.objectContaining({ id: 5, lastSync: 3, timestamp: 4242, permissions: 'new', ignoreDelete: true }))+ })++ it('should disable ignoreDelete when false is explicitly provided', async () => {+ syncQueries.clientExistsForOwner.mockResolvedValue(true)+ syncQueries.getPathSettings.mockResolvedValue({ id: 5, timestamp: 500, ignoreDelete: true })+ syncQueries.updatePathSettings.mockResolvedValue(undefined)+ vi.mocked(currentTimeStamp).mockReturnValue(4242)++ const out = await service.updatePath({ id: 1 } as any, 'c1', 5, { ignoreDelete: false } as any)++ expect(syncQueries.updatePathSettings).toHaveBeenCalledWith('c1', 5, expect.objectContaining({ ignoreDelete: false }))+ expect(out.ignoreDelete).toBe(false)})it('should clear cache and throw INTERNAL_SERVER_ERROR when update fails', async () => {@@ -355,6 +388,28 @@ describe(SyncPathsManager.name, () => {// No client update instructions because hasUpdates=false and serverNewer=false})+ it('should preserve ignoreDelete when a newer legacy client omits it', async () => {+ syncQueries.clientExistsForOwner.mockResolvedValue(true)+ syncQueries.getPaths.mockResolvedValue([{ id: 5, settings: { timestamp: 1, lastSync: 1, ignoreDelete: true }, remotePath: 'SPACES/x' }])+ spacesManager.spaceEnv.mockResolvedValue({ envPermissions: 'p' })++ const client = [{ id: 5, timestamp: 10, lastSync: 2, remotePath: 'SPACES/x', permissions: 'p' } as any]+ await service.updatePaths(userWith('c1') as any, client)++ expect(syncQueries.updatePathSettings).toHaveBeenCalledWith('c1', 5, expect.objectContaining({ ignoreDelete: true }))+ })++ it('should disable ignoreDelete when a newer client explicitly sends false', async () => {+ syncQueries.clientExistsForOwner.mockResolvedValue(true)+ syncQueries.getPaths.mockResolvedValue([{ id: 5, settings: { timestamp: 1, lastSync: 1, ignoreDelete: true }, remotePath: 'SPACES/x' }])+ spacesManager.spaceEnv.mockResolvedValue({ envPermissions: 'p' })++ const client = [{ id: 5, timestamp: 10, lastSync: 2, remotePath: 'SPACES/x', permissions: 'p', ignoreDelete: false } as any]+ await service.updatePaths(userWith('c1') as any, client)++ expect(syncQueries.updatePathSettings).toHaveBeenCalledWith('c1', 5, expect.objectContaining({ ignoreDelete: false }))+ })+it('should push server-newer updates to client and also remotePath/permissions corrections', async () => {syncQueries.clientExistsForOwner.mockResolvedValue(true)syncQueries.getPaths.mockResolvedValue([{ id: 7, settings: { timestamp: 20, lastSync: 5, srv: true }, remotePath: 'SPACES/correct' }])diff --git a/backend/src/applications/sync/services/sync-paths-manager.service.ts b/backend/src/applications/sync/services/sync-paths-manager.service.tsindex 2be59e7d..2fc74f95 100644--- a/backend/src/applications/sync/services/sync-paths-manager.service.ts+++ b/backend/src/applications/sync/services/sync-paths-manager.service.ts@@ -57,6 +57,8 @@ export class SyncPathsManager {syncPathDto.remotePath = req.params['*']// add permissions (skip end point protection using getEnvPermission)syncPathDto.permissions = getEnvPermissions(req.space, req.space.root)+ // Backward compatibility: clients predating this setting omit it.+ syncPathDto.ignoreDelete = syncPathDto.ignoreDelete === trueconst pathId = await this.syncQueries.createPath(client.id, syncDBProps, syncPathDto)return { id: pathId, permissions: syncPathDto.permissions }}@@ -88,7 +90,12 @@ export class SyncPathsManager {// delete possible iddelete syncPathUpdateDto.id// update current path settings+ const currentIgnoreDelete = syncPathSettings.ignoreDeleteObject.assign(syncPathSettings, syncPathUpdateDto)+ // Partial updates from older clients must not reset an already enabled value.+ if (syncPathUpdateDto.ignoreDelete === undefined) {+ syncPathSettings.ignoreDelete = currentIgnoreDelete+ }syncPathSettings.timestamp = currentTimeStamp()try {await this.syncQueries.updatePathSettings(clientId, pathId, syncPathSettings)@@ -162,7 +169,13 @@ export class SyncPathsManager {let updatedSettings: SyncPathSettings = { ...serverPath.settings, ...updateClientInfo }if (clientNewer) {- updatedSettings = { ...clientPath, ...updateClientInfo }+ // A legacy client does not send ignoreDelete. Preserve the server value+ // in that case, while still accepting an explicit false from newer clients.+ updatedSettings = {+ ...clientPath,+ ignoreDelete: clientPath.ignoreDelete ?? serverPath.settings.ignoreDelete ?? false,+ ...updateClientInfo+ }} else if (serverNewer) {clientDiff.update.push({ id: clientPath.id, ...serverPath.settings, ...updateClientInfo })}diff --git a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.html b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.htmlindex 23f3e9ec..bb68a2bb 100644--- a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.html+++ b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.html@@ -93,6 +93,21 @@</div></div>+ <div class="sync-settings-row">+ <label class="sync-settings-label form-label mb-0" for="sync-path-ignore-delete">+ <svg [lucideIcon]="icons.LucideTrashOff"></svg>+ <span class="ms-2" l10nTranslate>Deletion</span>+ </label>+ <div class="sync-settings-control sync-settings-control--checkbox">+ <input+ id="sync-path-ignore-delete"+ [(ngModel)]="syncPath.settings.ignoreDelete"+ class="form-check-input"+ type="checkbox">+ <label class="sync-settings-checkbox-help" for="sync-path-ignore-delete" l10nTranslate>Deletions are not synchronized.</label>+ </div>+ </div>+<div class="sync-settings-row"><label class="sync-settings-label form-label mb-0" for="sync-path-scheduler-value"><svg [lucideIcon]="icons.LucideClock"></svg>diff --git a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.scss b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.scssindex e9cced7d..13ece686 100644--- a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.scss+++ b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.scss@@ -88,6 +88,22 @@}}+.sync-settings-control--checkbox {+ display: flex;+ align-items: center;+ gap: 0.5rem;++ .form-check-input {+ flex: 0 0 auto;+ margin-top: 0;+ }++ .sync-settings-checkbox-help {+ cursor: pointer;+ font-weight: 400;+ }+}+@media (max-width: 575.98px) {.sync-settings-panel--small .sync-settings-section {max-width: 100%;diff --git a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.tsindex 77654150..a5b1435b 100755--- a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts+++ b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts@@ -1,6 +1,15 @@import { Component, inject, Input } from '@angular/core'import { FormsModule } from '@angular/forms'-import { LucideBug, LucideCircleAlert, LucideClock, LucideDynamicIcon, LucideGauge, LucideRefreshCw, LucideSquarePen } from '@lucide/angular'+import {+ LucideBug,+ LucideCircleAlert,+ LucideClock,+ LucideDynamicIcon,+ LucideGauge,+ LucideRefreshCw,+ LucideSquarePen,+ LucideTrashOff+} from '@lucide/angular'import {SYNC_PATH_CONFLICT_MODE,SYNC_PATH_DIFF_MODE,@@ -33,6 +42,7 @@ export class SyncPathSettingsComponent {LucideClock,LucideRefreshCw,LucideSquarePen,+ LucideTrashOff,LucideBug}protected readonly SYNC_PATH_CONFLICT_MODE = SYNC_PATH_CONFLICT_MODEdiff --git a/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts b/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.tsindex 1332a083..66045166 100644--- a/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts+++ b/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts@@ -36,6 +36,7 @@ export class SyncWizardSettingsComponent {remotePath: this.syncService.wizard.remotePath.serverPath,enabled: this.syncService.wizard.settings.enabled,mode: this.syncService.wizard.remotePath.isWriteable ? this.syncService.wizard.settings.mode : SYNC_PATH_MODE.DOWNLOAD,+ ignoreDelete: this.syncService.wizard.settings.ignoreDelete,conflictMode: this.syncService.wizard.settings.conflictMode,diffMode: this.syncService.wizard.settings.diffMode,scheduler: this.syncService.wizard.settings.scheduler,diff --git a/frontend/src/app/applications/sync/models/sync-path.model.ts b/frontend/src/app/applications/sync/models/sync-path.model.tsindex e08c8974..dbae20af 100644--- a/frontend/src/app/applications/sync/models/sync-path.model.ts+++ b/frontend/src/app/applications/sync/models/sync-path.model.ts@@ -49,6 +49,8 @@ export class SyncPathModel implements Partial<SyncPath> {} else {Object.assign(this, props)}+ // Payloads from older clients or servers do not contain this setting.+ this.settings.ignoreDelete = this.settings.ignoreDelete === truethis.setProperties()this.setStatus(false)}@@ -78,6 +80,7 @@ export class SyncPathModel implements Partial<SyncPath> {...(withId ? { id: this.id } : {}),name: this.settings.name,mode: this.settings.mode,+ ignoreDelete: this.settings.ignoreDelete,enabled: this.settings.enabled,diffMode: this.settings.diffMode,conflictMode: this.settings.conflictMode,diff --git a/frontend/src/app/applications/sync/services/sync.service.ts b/frontend/src/app/applications/sync/services/sync.service.tsindex 81c0602a..feb296fd 100644--- a/frontend/src/app/applications/sync/services/sync.service.ts+++ b/frontend/src/app/applications/sync/services/sync.service.ts@@ -43,6 +43,7 @@ export class SyncService {conflictMode: SYNC_PATH_CONFLICT_MODEdiffMode: SYNC_PATH_DIFF_MODEenabled: boolean+ ignoreDelete: booleanmode: SYNC_PATH_MODEname: stringscheduler: { unit: string; value: number }@@ -180,6 +181,7 @@ export class SyncService {remotePath: null,settings: {enabled: true,+ ignoreDelete: false,name: '',mode: SYNC_PATH_MODE.BOTH,conflictMode: SYNC_PATH_CONFLICT_MODE.RECENT,diff --git a/frontend/src/i18n/de.json b/frontend/src/i18n/de.jsonindex 0b1be4f6..f5e7e5c6 100644--- a/frontend/src/i18n/de.json+++ b/frontend/src/i18n/de.json@@ -547,6 +547,8 @@"Error": "Fehler","Server": "Server","Direction": "Richtung",+ "Deletion": "Löschung",+ "Deletions are not synchronized.": "Löschungen werden nicht synchronisiert.","Conflict": "Konflikt","Show filtered files": "Gefilterte Dateien anzeigen","recent": "aktuell",diff --git a/frontend/src/i18n/es.json b/frontend/src/i18n/es.jsonindex 17069312..3686746a 100644--- a/frontend/src/i18n/es.json+++ b/frontend/src/i18n/es.json@@ -547,6 +547,8 @@"Error": "Error","Server": "Servidor","Direction": "Dirección",+ "Deletion": "Eliminación",+ "Deletions are not synchronized.": "Las eliminaciones no se sincronizan.","Conflict": "Conflicto","Show filtered files": "Mostrar archivos filtrados","recent": "reciente",diff --git a/frontend/src/i18n/fr.json b/frontend/src/i18n/fr.jsonindex 9f0c2e44..07e46d4d 100644--- a/frontend/src/i18n/fr.json+++ b/frontend/src/i18n/fr.json@@ -547,6 +547,8 @@"Error": "Erreur","Server": "Serveur","Direction": "Direction",+ "Deletion": "Suppression",+ "Deletions are not synchronized.": "Les suppressions ne sont pas synchronisées.","Conflict": "Conflit","Show filtered files": "Afficher les fichiers filtrés","recent": "récent",diff --git a/frontend/src/i18n/hi.json b/frontend/src/i18n/hi.jsonindex 92225aee..22ea1d94 100644--- a/frontend/src/i18n/hi.json+++ b/frontend/src/i18n/hi.json@@ -547,6 +547,8 @@"Error": "त्रुटि","Server": "सर्वर","Direction": "दिशा",+ "Deletion": "हटाना",+ "Deletions are not synchronized.": "हटाने की कार्रवाइयाँ सिंक्रनाइज़ नहीं की जातीं।","Conflict": "टकराव","Show filtered files": "फ़िल्टर की गई फ़ाइलें दिखाएँ","recent": "हाल का",diff --git a/frontend/src/i18n/it.json b/frontend/src/i18n/it.jsonindex 91a8afc1..e43bdf66 100644--- a/frontend/src/i18n/it.json+++ b/frontend/src/i18n/it.json@@ -547,6 +547,8 @@"Error": "Errore","Server": "Server","Direction": "Direzione",+ "Deletion": "Eliminazione",+ "Deletions are not synchronized.": "Le eliminazioni non vengono sincronizzate.","Conflict": "Conflitto","Show filtered files": "Mostra i file filtrati","recent": "recente",diff --git a/frontend/src/i18n/ja.json b/frontend/src/i18n/ja.jsonindex 4ac3c176..9fe71f90 100644--- a/frontend/src/i18n/ja.json+++ b/frontend/src/i18n/ja.json@@ -547,6 +547,8 @@"Error": "エラー","Server": "サーバー","Direction": "方向",+ "Deletion": "削除",+ "Deletions are not synchronized.": "削除は同期されません。","Conflict": "競合","Show filtered files": "フィルターされたファイルを表示","recent": "最近",diff --git a/frontend/src/i18n/ko.json b/frontend/src/i18n/ko.jsonindex 0aa50f13..0a794889 100644--- a/frontend/src/i18n/ko.json+++ b/frontend/src/i18n/ko.json@@ -547,6 +547,8 @@"Error": "오류","Server": "서버","Direction": "방향",+ "Deletion": "삭제",+ "Deletions are not synchronized.": "삭제 내용은 동기화되지 않습니다.","Conflict": "충돌","Show filtered files": "필터된 파일 표시","recent": "최근",diff --git a/frontend/src/i18n/nl.json b/frontend/src/i18n/nl.jsonindex d6140219..0d05bce2 100644--- a/frontend/src/i18n/nl.json+++ b/frontend/src/i18n/nl.json@@ -547,6 +547,8 @@"Error": "Fout","Server": "Server","Direction": "Richting",+ "Deletion": "Verwijdering",+ "Deletions are not synchronized.": "Verwijderingen worden niet gesynchroniseerd.","Conflict": "Conflict","Show filtered files": "Gefilterde bestanden weergeven","recent": "recent",diff --git a/frontend/src/i18n/pl.json b/frontend/src/i18n/pl.jsonindex 844b56db..2dcbf522 100644--- a/frontend/src/i18n/pl.json+++ b/frontend/src/i18n/pl.json@@ -547,6 +547,8 @@"Error": "Błąd","Server": "Serwer","Direction": "Kierunek",+ "Deletion": "Usunięcie",+ "Deletions are not synchronized.": "Usunięcia nie są synchronizowane.","Conflict": "Konflikt","Show filtered files": "Pokaż przefiltrowane pliki","recent": "ostatnie",diff --git a/frontend/src/i18n/pt-BR.json b/frontend/src/i18n/pt-BR.jsonindex 1167c1ee..53df4bd0 100644--- a/frontend/src/i18n/pt-BR.json+++ b/frontend/src/i18n/pt-BR.json@@ -547,6 +547,8 @@"Error": "Erro","Server": "Servidor","Direction": "Direção",+ "Deletion": "Eliminação",+ "Deletions are not synchronized.": "As eliminações não são sincronizadas.","Conflict": "Conflito","Show filtered files": "Mostrar arquivos filtrados","recent": "recentes",diff --git a/frontend/src/i18n/pt.json b/frontend/src/i18n/pt.jsonindex b00bbeb0..41da7d2a 100644--- a/frontend/src/i18n/pt.json+++ b/frontend/src/i18n/pt.json@@ -547,6 +547,8 @@"Error": "Erro","Server": "Servidor","Direction": "Direção",+ "Deletion": "Eliminação",+ "Deletions are not synchronized.": "As eliminações não são sincronizadas.","Conflict": "Conflito","Show filtered files": "Mostrar arquivos filtrados","recent": "recente",diff --git a/frontend/src/i18n/ru.json b/frontend/src/i18n/ru.jsonindex e612fb95..f9faf3a8 100644--- a/frontend/src/i18n/ru.json+++ b/frontend/src/i18n/ru.json@@ -547,6 +547,8 @@"Error": "Ошибка","Server": "Сервер","Direction": "Направление",+ "Deletion": "Удаление",+ "Deletions are not synchronized.": "Удаления не синхронизируются.","Conflict": "Конфликт","Show filtered files": "Показать отфильтрованные файлы","recent": "недавний",diff --git a/frontend/src/i18n/tr.json b/frontend/src/i18n/tr.jsonindex 4b3914fe..ee11bf5c 100644--- a/frontend/src/i18n/tr.json+++ b/frontend/src/i18n/tr.json@@ -547,6 +547,8 @@"Error": "Hata","Server": "Sunucu","Direction": "Yön",+ "Deletion": "Silme işlemi",+ "Deletions are not synchronized.": "Silme işlemleri eşitlenmez.","Conflict": "Çakışma","Show filtered files": "Filtrelenen dosyaları göster","recent": "son",diff --git a/frontend/src/i18n/zh.json b/frontend/src/i18n/zh.jsonindex b2e3ef0c..50a538b7 100644--- a/frontend/src/i18n/zh.json+++ b/frontend/src/i18n/zh.json@@ -547,6 +547,8 @@"Error": "错误","Server": "服务器","Direction": "方向",+ "Deletion": "删除",+ "Deletions are not synchronized.": "删除操作不会同步。","Conflict": "冲突","Show filtered files": "显示已过滤的文件","recent": "最近",