Skip to content

Commit 824bff8

Browse files
committed
feat(backend:files): extend indexing key generation for anchored roots
1 parent 0d842f1 commit 824bff8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

backend/src/applications/files/utils/indexing.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ export function indexingUpdateCacheKeysFromSpace(userId: number, space: SpaceEnv
1212
if (space.inSharesRepository && !space.root.externalPath) {
1313
// shares that are linked to a space must also be indexed
1414
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SHARE, '-')}`)
15+
} else if (space.inFilesRepository && space.root.owner?.login) {
16+
// space where the user’s root file is anchored
17+
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SPACE, '-')}`)
1518
}
1619
const repository: { id: number; type: FILE_REPOSITORY } = SpaceToFileRepository(userId, space)
17-
if (repository !== null) cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(repository.id, repository.type, '-')}`)
20+
if (repository !== null) {
21+
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(repository.id, repository.type, '-')}`)
22+
}
1823
return cacheKeys
1924
}

0 commit comments

Comments
 (0)