Skip to content

Commit bb316cd

Browse files
authored
fix: return empty activity channels when no subprojects are found (#4246)
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent c588174 commit bb316cd

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

backend/src/database/repositories/segmentRepository.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ class SegmentRepository extends RepositoryBase<
296296
}
297297

298298
async fetchTenantActivityChannels(segmentIds: string[]) {
299+
if (segmentIds.length === 0) {
300+
return {}
301+
}
302+
299303
const transaction = this.transaction
300304

301305
const records = await this.options.database.sequelize.query(

backend/src/services/activityService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export default class ActivityService extends LoggerBase {
108108

109109
const subprojectIds = await getSegmentSubprojectIds(qx, currentSegments)
110110

111+
if (subprojectIds.length === 0) {
112+
return {}
113+
}
114+
111115
return SegmentService.getTenantActivityChannels(subprojectIds, this.options)
112116
}
113117

0 commit comments

Comments
 (0)