kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Lesson size on the lesson summary page doesn't update after adding resources

Open Rishika-dev opened this issue 2 months ago • 4 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: develop

Observed behavior

On a lesson's summary page in Coach, the Size shown under General information stays at its old value after resources are added with Manage resources → Save & finish. It only shows the right size after the page is reloaded.

Removing or reordering resources on the same page does update the size straight away, so only the add path is affected.

Example from a local develop setup with the Kolibri QA Channel:

Step Size shown Size after reload
New empty lesson, add 6 videos (73 MB) — 73 MB
Remove "1. Introduction to Studio" with the ✕ button 16 MB (updates immediately) 16 MB
Add "1. Introduction to Studio" (56 MB) back with Manage resources 16 MB 73 MB

The Lessons list page shows the correct size, because saveLessonResources refreshes the class summary.

Looking at the code, the two save paths differ:

  • LessonSummaryPage/index.vue → save(resources) (line 331) calls saveLessonResources, then updateCurrentLesson(this.lessonId) and fetchLessonsSizes (line 342), so currentLesson.size is refreshed.
  • LessonSummaryPage/sidePanels/LessonResourceSelection/index.vue → save() (line 299) calls only saveLessonResources, then updates the working resources and closes the panel. currentLesson, including size, is never fetched again.

LessonStatus.vue renders lesson.size for the Size field (line 123). It also uses it in the "make lesson visible" / "make lesson not visible" modals (fileSizeToDownload / fileSizeToRemove, lines 160 and 177), which are shown when learner-only devices are in the class. I haven't tested that modal, but from the code it would show the same stale size.

Errors and logs

No errors in the browser console during these steps.

Expected behavior

After resources are added and saved, the Size on the lesson summary page reflects the new set of resources, the same as it does after removing or reordering resources.

User-facing consequences

Coaches see the wrong size for a lesson they have just built. An empty lesson keeps showing "—" after resources are added. If the class has learner-only devices, the "make lesson visible" confirmation can tell the coach the wrong amount of data that will be downloaded to those devices.

Steps to reproduce

  1. Sign in as a coach or admin and open Coach → a class → Lessons.
  2. Create a new lesson and save it. Size shows "—".
  3. Click Manage resources, select a few resources (the footer shows e.g. "6 resources selected (73 MB)"), and click Save & finish.
  4. Back on the lesson summary page, the resources are listed but Size still shows "—".
  5. Reload the page. Size now shows the correct value.

The same happens when adding resources to a lesson that already has some: the size stays at the previous value until reload.

Context

  • Kolibri develop at 6eda02702d (dev server)
  • macOS 26.6.2, Chrome
  • Kolibri QA Channel imported from Studio

If this is confirmed, the fix may be as small as refreshing the current lesson (as LessonSummaryPage/index.vue does) after saveLessonResources in LessonResourceSelection. I'd be glad to work on it.

AI usage

I used Claude Code to drive a browser through the coach lesson flows on my local Kolibri, where it noticed the stale size. It also traced the two save paths in the code and drafted this issue. I reviewed the code references against develop and edited the text.

Rishika-dev avatar Oct 01 '26 09:10 Rishika-dev

Hello! I’m interested in working on this issue as my first contribution to Kolibri. I noticed the issue says it is not open for contribution. Would it be possible to get permission to work on it? Thank you!

chrisfonseca8 avatar Oct 02 '26 22:10 chrisfonseca8

Hi! 👋

Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.

We really appreciate your willingness to help. 😊

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Oct 02 '26 22:10 learning-equality-bot

Confirmed. Assigning to you.

rtibbles avatar Oct 03 '26 02:10 rtibbles

Opened a fix in https://github.com/learningequality/kolibri/pull/15488, with a test and before/after recordings.

Rishika-dev avatar Oct 03 '26 15:10 Rishika-dev