Skip to content

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

feat(backend:files): extend indexing key generation for anchored roots

johaven824bff84c965
diff --git a/backend/src/applications/files/utils/indexing.ts b/backend/src/applications/files/utils/indexing.ts
index 79dace51..3d0a96f2 100644
--- a/backend/src/applications/files/utils/indexing.ts
+++ b/backend/src/applications/files/utils/indexing.ts
@@ -12,8 +12,13 @@ export function indexingUpdateCacheKeysFromSpace(userId: number, space: SpaceEnv
if (space.inSharesRepository && !space.root.externalPath) {
// shares that are linked to a space must also be indexed
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SHARE, '-')}`)
+ } else if (space.inFilesRepository && space.root.owner?.login) {
+ // space where the user’s root file is anchored
+ cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SPACE, '-')}`)
}
const repository: { id: number; type: FILE_REPOSITORY } = SpaceToFileRepository(userId, space)
- if (repository !== null) cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(repository.id, repository.type, '-')}`)
+ if (repository !== null) {
+ cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(repository.id, repository.type, '-')}`)
+ }
return cacheKeys
}