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
fix(backend:files): correct `isDir` SQL logic to handle external paths without associated file IDs
johavenb3ce7d4ae665
diff --git a/backend/src/applications/files/services/files-content-manager.service.ts b/backend/src/applications/files/services/files-content-manager.service.tsindex 1ce07e5c..8f34ed44 100644--- a/backend/src/applications/files/services/files-content-manager.service.ts+++ b/backend/src/applications/files/services/files-content-manager.service.ts@@ -128,7 +128,7 @@ export class FilesContentManager {}}} catch (e) {- this.logger.warn(`${this.parseFiles.name} - ${context.indexSuffix} - unable to parse : ${dir} : ${e}`)+ this.logger.warn(`${this.parseFiles.name} - ${context.indexSuffix} - unable to parse: ${dir} - ${e}`)}}@@ -145,7 +145,7 @@ export class FilesContentManager {try {stats = await fs.stat(realPath)} catch (e) {- this.logger.warn(`${this.analyzeFile.name} - unable to stats ${realPath} : ${e}`)+ this.logger.warn(`${this.analyzeFile.name} - unable to stats: ${realPath} - ${e}`)return null}if (stats.size === 0 || stats.size > this.maxDocumentSize) {@@ -190,7 +190,7 @@ export class FilesContentManager {)return content.length ? content : null} catch (e) {- this.logger.warn(`${this.parseContent.name} - unable to index : ${rPath} : ${e}`)+ this.logger.warn(`${this.parseContent.name} - unable to index: ${rPath} - ${e}`)}return null}diff --git a/backend/src/applications/files/services/files-parser.service.ts b/backend/src/applications/files/services/files-parser.service.tsindex a6c08679..d0df7d9f 100644--- a/backend/src/applications/files/services/files-parser.service.ts+++ b/backend/src/applications/files/services/files-parser.service.ts@@ -103,7 +103,7 @@ export class FilesParser {id: shares.id,alias: shares.alias,externalPath: sql<string>`IF (${shares.externalPath} IS NOT NULL, ${shares.externalPath}, ${spacesRoots.externalPath})`,- isDir: sql<boolean>`IF (${shares.externalPath} IS NOT NULL, 1, ${files.isDir})`,+ isDir: sql<boolean>`IF (${shares.externalPath} IS NOT NULL AND ${shares.fileId} IS NULL, 1, ${files.isDir})`,file: { path: sql<string>`IF (${files.id} IS NOT NULL, ${filePathSQL(files)}, '.')`, fromOwner: users.login, fromSpace: spaces.alias }}).from(shares)