-
-
Notifications
You must be signed in to change notification settings - Fork 428
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The Output page crashes at runtime with:
TypeError: Cannot read properties of undefined (reading 'forEach')
This happens when stored payload keys are missing or malformed, and the page assumes arrays always exist before iterating.
Affected page:
Why this is high priority
- It breaks the core quiz result flow on the web UI.
- Users see a blank/error overlay instead of generated questions.
- It is reproducible and user-facing.
Current behavior
The page calls forEach on values that may be undefined, such as:
outputoutput_mcq.questionsoutput_boolq.Boolean_Questions
When any of these keys are absent, React crashes in the effect hook.
Expected behavior
The Output page should:
- Safely parse local storage data.
- Treat missing arrays as empty arrays.
- Render without crashing even if payload shape is partial.
Steps to Reproduce
- Generate questions with a payload shape that does not include all expected keys.
- Open the Output page.
- Observe runtime crash:
Cannot read properties of undefined (reading 'forEach').
Environment Details
No response
Impact
High - Major feature is broken
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working