Auto-refresh course unit reports on learner activity notifications
Summary
The course summary page now auto-refreshes unit report data when learner activity notifications arrive for the current course session, so coaches no longer need to manually refresh to see test score updates, lesson completion progress, or status changes.
This reuses the existing coachNotifications polling mechanism — no new polling is introduced. The course_session_id field was already on the LearnerProgressNotification model but not serialized; adding it to the API values tuple is the only backend change needed.
References
Closes learningequality/kolibri#14458
Reviewer guidance
To test: open a course summary page as a coach, then have a learner complete activities in that course — unit report data should update without a page refresh.
Area deserving close review: the baseline-tracking logic in useCourseNotificationPolling.js — it captures the initial maxNotificationTimestamp on first watch invocation so that pre-existing notifications don't trigger a spurious re-fetch on page load. The composable tests cover this path, but the logic is easy to break.
AI usage
This PR was implemented by Claude Code following a pre-written implementation plan. I reviewed the generated code and verified the tests pass.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Ran pre-flight CI checks (lint, format, tests) and verified all pass
- Rebased onto the target branch and resolved any conflicts
- Reorganized commit history into clean, logical commits
- Audited the diff to ensure only issue-relevant files are changed
- Built PR body from the repository's PR template with evidence blocks
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-0.19.6.dev1737_g46fef7c08.d20260717.pex |
| Windows Installer (EXE) | kolibri-0.19.6.dev1737+g46fef7c08.d20260717-windows-setup-unsigned.exe |
| Debian Package | kolibri_0.19.6.dev1737+g46fef7c08-0ubuntu1_all.deb |
| Debian Package | kolibri-server_0.19.6~dev1737+g46fef7c08.d20260717-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.19.6.dev1737+g46fef7c08.d20260717.dmg |
| Android Package (APK) | kolibri-0.19.6.dev1737+g46fef7c08-debug.apk |
| Raspberry Pi Image | kolibri-pi-image-0.19.6.dev1737+g46fef7c08.zip |
| TAR file | kolibri-0.19.6.dev1737+g46fef7c08.d20260717.tar.gz |
| WHL file | kolibri-0.19.6.dev1737+g46fef7c08.d20260717-py3-none-any.whl |
Smoke test screenshot
What needs to be done to make this ready for review? It's still a draft currently.
Rebased onto latest upstream develop and marked as ready for review.
Rebased onto latest develop. The PR was already undrafted — it's been open (not draft) since initial submission.
Let's rebase this onto latest develop, as the Course summary page changes have just landed - no merge conflict, but let's make sure they're both in sync.
Rebased onto latest develop — all tests and lint pass.
Wired useCourseNotificationPolling into UnitDetailPage too. Exposed fetchData from useUnitDetail and pass it as the re-fetch callback, so pre/post scores, learning objectives and lesson progress now refresh on course-session notifications — same as the summary page. Covered by a wiring test in UnitDetailPage.spec.js (the fetch behaviour itself is covered by useCourseNotificationPolling.spec.js).
Also rebased onto latest develop.
The unit detail page is wired up in the current HEAD (34c1165). Your review was against bae4316d, which predates that push by a few minutes — useUnitDetail now exposes fetchData, and UnitDetailPage calls useCourseNotificationPolling(store, courseSessionId, fetchData) the same way CourseSummaryPage does, so pre/post scores, learning objectives and lesson progress re-fetch on a matching course-session notification. Test added in UnitDetailPage.spec.js ("re-fetches unit detail data on course-session notifications").