Skip to content

[BUG FIX] [MER-5998] Normalize legacy audio elements - #305

Merged
rgachuhi merged 1 commit into
masterfrom
mer-5998-fix-audio-choice-structure
Sep 30, 2026
Merged

rgachuhi merged 1 commit into
masterfrom
mer-5998-fix-audio-choice-structure

Conversation

@andersweinstein

@andersweinstein andersweinstein commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • normalize legacy <audio><source> attributes using the same approach as legacy video sources
  • promote nested source metadata when the parent audio element does not provide it
  • emit audio as a Slate void element with a single text child
  • add regression coverage for the problematic legacy structure and source-only audio elements

Problem

Legacy audio elements can contain caption, popout, and source children. During conversion, the source element's XML type attribute could overwrite its JSON node discriminator, leaving a non-text child inside the generated audio element. Torus delivery could tolerate this structure, but the Slate authoring editor expects audio to be a void element and fails while rendering it.

This change preserves the scalar audio metadata on the parent and removes the invalid legacy child structure.

Verification

  • npm test -- --runInBand test/resources/common-test.ts — 10 tests passed
  • AWS_S3_PORT=9000 npm test -- --runInBand — 36 suites and 150 tests passed
  • npm run prettier — passed
  • npm run lint — passed with three pre-existing warnings in src/resources/webcontent.ts
  • full conversion of the French 101 Pima legacy course completed successfully
    • 2,859 generated audio nodes
    • 0 malformed audio child structures
    • 0 missing audio sources
    • 0 JSON parse errors
  • representative French 101 Pima pages and activities were ingested and manually inspected in Torus authoring; the sampled instances rendered correctly

Jira: MER-5998

@rgachuhi
rgachuhi merged commit 76df8ba into master Sep 30, 2026
2 checks passed
@rgachuhi
rgachuhi deleted the mer-5998-fix-audio-choice-structure branch September 30, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants