Skip to content

Fix: Recover from unresolvable _start ids on import#221

Merged
taylortom merged 1 commit into
masterfrom
fix/start-page-recovery
Jun 26, 2026
Merged

Fix: Recover from unresolvable _start ids on import#221
taylortom merged 1 commit into
masterfrom
fix/start-page-recovery

Conversation

@taylortom

Copy link
Copy Markdown
Contributor

Fixes #220

Fix

  • When a course's _start._startIds[]._id references content missing from the import, the StartPage transform previously logged a warning and left the dangling id in place, producing a course that loads indefinitely (the player can't find a start page).
  • Now it recovers:
    • Single-page course → default the start to that page (rewrites the start id to its _friendlyId, generating one if absent).
    • Otherwise (0 or >1 pages) → remove the _start config so the course loads its menu.
  • A warning is still logged in both cases; resolvable start ids behave exactly as before.

Testing

  • New unit tests in tests/migrations.spec.js: single-page fallback, generated-_friendlyId fallback, and _start removal when not exactly one page.
  • Full suite: 199 passing; standard clean.

Note

  • The transform runs at import time, so existing broken courses must be re-imported to recover.

When a course's _start._startIds references content not present in the
import, the StartPage transform previously left the dangling id in place,
producing a course that loads indefinitely (the player cannot find a start
page).

Recover gracefully: if the course has exactly one page, default the start
to it; otherwise remove the _start config so the menu loads. A warning is
logged in both cases and resolvable start ids are unchanged.
@taylortom
taylortom merged commit 884b3a9 into master Jun 26, 2026
2 checks passed
@taylortom
taylortom deleted the fix/start-page-recovery branch June 26, 2026 10:25
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imported course hangs when _start references content missing from the package

1 participant