generated from mantinedev/vite-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Some reports in the database are marked with status: "complete" but have an empty output ("{}"). When the app tries to render these reports, it crashes with:
Cannot read properties of undefined (reading 'budgetary_impact')
Root Cause
This is a server-side issue where calculations fail but reports are incorrectly marked as "complete" with an empty object instead of being marked as "error".
Affected Reports (Examples)
- Report 538:
status: "complete",output: "{}" - Report 539:
status: "complete",output: "{}"
Compared to working report:
- Report 530:
status: "complete",output: <64KB valid data>
Suggested Fixes
Server-side (Primary)
Investigate why the API/backend is marking failed calculations as "complete" with empty output. The proper behavior should be:
- Mark report as
status: "error"when calculation fails - Store error message in report metadata
- Never store empty
{}as output for complete reports
Client-side (Defensive)
Add validation guards to prevent crashes when encountering malformed data:
- Add
isValidSocietyWideOutput()type guard inSocietyWideReportOutput.tsx - Add early returns in components that access nested output properties
- Show error page instead of crashing when output is incomplete
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working