Course data should be updated without needing to refresh the page
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
The course summary and unit report pages require a manual page refresh to reflect new learner activity (test scores, lesson progress, test status changes). The coach should see updates automatically by polling the existing notifications endpoint for course-session-specific notifications and re-fetching stale data when new activity is detected.
Complexity: Medium Target branch: release-v0.19.x
Context
Original report from @pcenov:
- When I go to the 'Units' tab and I start or stop a test and then I go to the 'Learning objectives' tab I have to manually refresh the page to see the new state:
https://github.com/user-attachments/assets/4365d2e3-7da3-4d34-bdea-5b0a759638cd
Originally posted in https://github.com/learningequality/kolibri/issues/14440#issuecomment-4136515915
- The existing coach notification polling system (
coachNotificationsVuex module) polls the notifications endpoint withclassroom_idandaftertimestamp, then passes new notifications toclassSummary/updateWithNotificationsto update in-memory status maps - Polling interval scales with number of coaches polling (2-20 seconds)
- Course session notifications (#14474) will add
course_session_idto notification records, enabling filtering for course-specific activity - This work involves changes to the course summary page and the unit detail page (#14471)
The Change
- On course pages, watch for new notifications matching the current
course_session_idfrom the existing notification polling - When course-relevant notifications arrive, re-fetch the unit report data for affected units
- This covers test score updates, test status changes, and lesson completion progress
Out of Scope
- Incremental in-memory updates from notification data (re-fetch is sufficient for now)
- Applying the same pattern to lesson and quiz reports (existing class summary notification handling covers those)
Acceptance Criteria
General
- [ ] Course pages detect new notifications matching the current
course_session_idfrom the existing polling mechanism - [ ] Unit report data is re-fetched when course-relevant notifications arrive
- [ ] Test score changes (pre/post test) are reflected without page refresh
- [ ] Lesson completion progress updates are reflected without page refresh
- [ ] Test status changes (activated/closed) are reflected without page refresh (these are coach actions — may require re-fetch on tab switch rather than notification polling)
Testing
- [ ] Tests written before implementation (TDD)
- [ ] Notification filtering by
course_session_idis tested - [ ] Data re-fetch triggered correctly on new notifications
- [ ] No unnecessary re-fetches when notifications are for a different course session
References
- Original report: https://github.com/learningequality/kolibri/issues/14440#issuecomment-4136515915
- Existing notification polling:
kolibri/plugins/coach/frontend/modules/coachNotifications/index.js - Notification-driven updates:
kolibri/plugins/coach/frontend/modules/classSummary/actions.js(updateWithNotifications)
AI usage
This issue was drafted collaboratively with Claude Code. The existing notification polling mechanism was traced to inform the integration approach.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.