Skip to content

Commit 5f4a2b5

Browse files
committed
Remove findAll call from DatasetServiceImpl.findAllDatasets
Apparently, findAll() implementation of RedisDocumentRepository is buggy in redis-om-spring version 0.6.4. So we for a query to bypass the problem here. We force a filter on organizationId.
1 parent ec3da35 commit 5f4a2b5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ class DatasetServiceIntegrationTest : CsmRedisTestBase() {
354354

355355
logger.info("should find all datasets and assert there are $numberOfDatasets")
356356
var datasetList = datasetApiService.findAllDatasets(organizationSaved.id!!, null, null)
357-
assertEquals(numberOfDatasets + 1, datasetList.size)
357+
assertEquals(numberOfDatasets, datasetList.size)
358358

359359
logger.info("should find all datasets and assert it equals defaultPageSize: $defaultPageSize")
360360
datasetList = datasetApiService.findAllDatasets(organizationSaved.id!!, 0, null)
@@ -366,7 +366,7 @@ class DatasetServiceIntegrationTest : CsmRedisTestBase() {
366366

367367
logger.info("should find all solutions and assert it returns the second / last page")
368368
datasetList = datasetApiService.findAllDatasets(organizationSaved.id!!, 1, expectedSize)
369-
assertEquals(numberOfDatasets - expectedSize + 1, datasetList.size)
369+
assertEquals(numberOfDatasets - expectedSize, datasetList.size)
370370
}
371371

372372
@Test

dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class DatasetServiceImpl(
142142
val currentUser = getCurrentAccountIdentifier(this.csmPlatformProperties)
143143
datasetRepository.findByOrganizationId(organizationId, currentUser, it).toList()
144144
} else {
145-
datasetRepository.findAll(it).toList()
145+
datasetRepository.findByOrganizationIdNoSecurity(organizationId, it).toList()
146146
}
147147
}
148148
} else {
@@ -151,7 +151,7 @@ class DatasetServiceImpl(
151151
val currentUser = getCurrentAccountIdentifier(this.csmPlatformProperties)
152152
datasetRepository.findByOrganizationId(organizationId, currentUser, pageable).toList()
153153
} else {
154-
datasetRepository.findAll(pageable).toList()
154+
datasetRepository.findByOrganizationIdNoSecurity(organizationId, pageable).toList()
155155
}
156156
}
157157

0 commit comments

Comments
 (0)