diff --git a/src/app/statistics-page/cris-statistics-page/cris-statistics-page.component.ts b/src/app/statistics-page/cris-statistics-page/cris-statistics-page.component.ts index 0963e17b177..1270935282f 100644 --- a/src/app/statistics-page/cris-statistics-page/cris-statistics-page.component.ts +++ b/src/app/statistics-page/cris-statistics-page/cris-statistics-page.component.ts @@ -281,7 +281,14 @@ export class CrisStatisticsPageComponent implements OnInit, OnDestroy { getReports$(categoryId) { return this.scope$.pipe( switchMap((scope) => { - return this.usageReportService.searchStatistics(scope._links.self.href, 0, 50, categoryId, this.parseDate(this.dateFrom), this.parseDate(this.dateTo), true); + // NOTE: do NOT request the points-stripping projection (excludePoints=true) here. + // searchStatistics and loadFullReport()'s findById resolve the SAME usagereports/{uuid}_{type} + // resource, so they share a single object-cache slot (keyed by self href, last-writer-wins). + // A points-less search representation can overwrite the full report loaded by findById + // (e.g. under SSR/TransferState or a re-emitted search), making the table intermittently + // render "No data available" even though the REST response contains points. Keeping the + // full representation here guarantees every cache write for a report includes its points. + return this.usageReportService.searchStatistics(scope._links.self.href, 0, 50, categoryId, this.parseDate(this.dateFrom), this.parseDate(this.dateTo)); }), ); } diff --git a/src/app/statistics-page/cris-statistics-page/statistics-chart/statistics-table/statistics-table.component.ts b/src/app/statistics-page/cris-statistics-page/statistics-chart/statistics-table/statistics-table.component.ts index 87e3cde30e2..2bec48981df 100644 --- a/src/app/statistics-page/cris-statistics-page/statistics-chart/statistics-table/statistics-table.component.ts +++ b/src/app/statistics-page/cris-statistics-page/statistics-chart/statistics-table/statistics-table.component.ts @@ -79,7 +79,7 @@ export class StatisticsTableComponent extends StatisticsChartDataComponent imple * Insert table headers */ ngOnInit() { - this.hasData = !!this.report && this.report.points.length > 0; + this.hasData = !!this.report && (this.report.points?.length ?? 0) > 0; if (this.hasData) { const point = this.report.points[0]; this.headers.push(point.type);