Skip to content

Race condition during language switch #120

@joe-replin

Description

@joe-replin

Subject of the issue/enhancement/features

When reloading a course or switching language mid-course, several core plug-ins that depend on the course model (notably trickle, page-level progress and assessment) run too early and encounter partially-built model objects. This causes runtime errors after a language change or reload.

Your environment

  • FW v5.48.1
  • Chrome/Edge/Firefox
  • Windows

Steps to reproduce

  1. Open a built course (for example the m10 or m25 build) in a browser.
  2. Start a session and progress to content that uses trickle, page-level progress or contains an assessment.
  3. While mid-course either reload the course page, or change the active course language (use the language picker or the course language switch).
  4. Observe the console and behavior immediately after the reload/language change.

Expected behavior

  • After a language change or reload, plug-ins that use the complete course model should run only when model instances are fully built and safe to use.
  • Assessment, trickle and page-level progress behavior should continue to work normally after a language change or reload (no uncaught runtime errors).

Actual behavior

  • During the language rebuild some model objects aren't fully built. When core plug-ins call instance methods that rely on prototypes, a runtime error is thrown (TypeError) and plug-in logic is skipped or breaks.
  • Example console error observed: Uncaught TypeError: model.findDescendantModels is not a function
  • Page-level progress and trickle logic may re-initialize at the wrong time and not reflect the rebuilt model correctly.
  • Storage/state writes around init/restore are more frequent than expected (repeated writes to suspend_data / offlineStorage observed during some reload/language-change sequences).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions