Open jnm opened 4 years ago
First debugging observations:
data.percentages
with value [100.0]
data.values[0][1].percentage
with value []
data.values[0][1].percentages
(mind the s) and this is causing the crash as spread operator is merging array
with undefined
percentage
then it doesn't crash, but still empty percentage
array is causing the charts to render emptyInteresting; just looking quickly now and percentages
happens when KPI aggregates some percentage
(singular) data that comes from formpack:
https://github.com/kobotoolbox/kpi/blob/ff4326e85a33fd1008a0525359d67718ced01501/kobo/apps/reports/report_data.py#L142-L153
Until we figure out what's really happening, it would definitely be an improvement to show blank or no graphs. That would at least let someone remove whatever report setting had broken stuff (e.g. "group by") and keep working.
@jnm here you are: https://github.com/kobotoolbox/kpi/compare/two-databases...2562-fix-auto-report-crash - should I make a PR out of it?
With a particular project (see details) the application crashes when attempting to view the auto-report. If the backend is not doing its job correctly (I haven't had time to check yet), then let's open a new issue about that. Still, the frontend shouldn't crash in this scenario :wink:
Support request: https://github.com/orgs/kobotoolbox/projects/23#card-29620986
Sentry: https://sentry.kbtdev.org/kobo/kpi-frontend-dev/issues/307009/