Quiz question settings crash when the channel list fails to load
🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
- Confirm that you’ve read the guidelines in your comment.
Target branch: develop
Observed behavior
The quiz question settings page throws a TypeError (see Errors and logs) when the channel list request has failed:
QuestionsSettings.vue#L91-L97callschannels.value.reduceonchannelsFetch.data.useFetchstartsdataasnulland leaves itnullwhen the fetch throws.
Errors and logs
Sentry: KOLIBRI-FRONTEND-13XK
Trace
TypeError: Cannot read properties of null (reading 'reduce')
at addableQuestionCount (webpack://kolibri-root/kolibri/plugins/coach/assets/src/views/quizzes/CreateExamPage/sidePanels/QuizResourceSelection/subPages/QuestionsSettings.vue:94:1)
at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:25830)
at get c.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:21763)
at <object>.get (./node_modules/vue/dist/vue.runtime.common.prod.js:11:8805)
at render (./kolibri/plugins/coach/assets/src/views/quizzes/CreateExamPage/sidePanels/QuizResourceSelection/subPages/QuestionsSettings.vue:18:28)
at t.prototype._render (./node_modules/vue/dist/vue.runtime.common.prod.js:11:44429)
at o (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74040)
at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
at wn (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24890)
at t (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74054)
at xo.prototype.$mount (./node_modules/vue/dist/vue.runtime.common.prod.js:11:73929)
at Zn.init (./node_modules/vue/dist/vue.runtime.common.prod.js:11:29532)
at n (./node_modules/vue/dist/vue.runtime.common.prod.js:11:33371)
at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:62186)
at d (./node_modules/vue/dist/vue.runtime.common.prod.js:11:62073)
at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65379)
at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65086)
at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65086)
at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
at __patch__ (./node_modules/vue/dist/vue.runtime.common.prod.js:11:66745)
at t.prototype._update (./node_modules/vue/dist/vue.runtime.common.prod.js:11:43408)
at o (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74030)
at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:25594)
at Vn (./node_modules/vue/dist/vue.runtime.common.prod.js:11:27459)
at e (./node_modules/vue/dist/vue.runtime.common.prod.js:11:20120)
at Ye (./node_modules/vue/dist/vue.runtime.common.prod.js:11:19552)
User-facing consequences
The quiz resource selection panel breaks, and the coach cannot add questions to the section.
Steps to reproduce
- In browser DevTools Network tab, block requests matching
/api/content/channel. - As a coach, create a new quiz and click Add questions in a section.
- The console shows the
TypeError.
Acceptance Criteria
- [ ] When the channel request fails, the question settings page shows an error icon and the core
defaultErrorMessage$()string in place of the settings form, asCoursePreviewSidePanel.vue#L66-L69does. - [ ] Continue is disabled while the error shows.
- [ ] A new
QuestionsSettingsspec covers a failed channel request.
AI usage
Claude Code traced the null source and drafted this revision; @marcellamaki filed the Sentry report.
Sentry Issue: KOLIBRI-FRONTEND-13XK
Hi! 👋
This issue is available for contribution and supports self-assignment. Here's how to get started:
- Comment
/assignto assign yourself to this issue - You can have up to 2 issues assigned at a time across all community repos
- Dropping an issue has a 7-day cooldown before the slot opens up
- Link your pull request to this issue when you submit it
📖 Read the Contributing guidelines before starting.
Are you preparing for Google Summer of Code? See our GSoC guidelines.
/assign
I have read the contribution and generative AI guidelines. I would like to fix the failed-channel state, disable Continue while it is shown, and add the focused QuestionsSettings regression spec described in the acceptance criteria.
Hi! 👋
You've been assigned to this issue. Here's what to do next:
- Read the issue description carefully and make sure you understand the requirements
- Link your pull request to this issue when you submit it
- If you can no longer work on this, unassign yourself so others can pick it up
Good luck! 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.