Skip to content

fix: keep <tie> in serialized <note> children (#60) - #62

Merged
thaihuynhxyz merged 1 commit into
mainfrom
fix/note-tie-children
Aug 7, 2026
Merged

fix: keep <tie> in serialized <note> children (#60)#62
thaihuynhxyz merged 1 commit into
mainfrom
fix/note-tie-children

Conversation

@thaihuynhxyz

Copy link
Copy Markdown
Collaborator

Closes #60. Replaces #61.

Problem

The <note> constructor built its child list without the parsed ties, so every <tie> was dropped on serialization. Parse a file and write it back, and the tie information was gone.

<tied> inside <notations> was never broken on its own — it disappeared for the same reason, because the parent <note> never carried the tie into its children at all.

Fix

One line: add ...ties to the child list, in the slot the MusicXML content model gives it, between <duration> and <voice>.

Credit

@SheepYang1993 found this in #60 and wrote the same one-line fix in #61. That PR also added a syncChildrenToXml() layer that re-appended the ties at serialize time, which moved <tie> after <stem> and broke the spec order, so this PR keeps only the constructor change. Thank you for the report and the fix.

Test plan

  • dart test — 113 pass (3 new)
  • dart analyze — clean
  • dart format — no changes
  • All 3 new tests fail on main and pass here

The <note> constructor built its child list without the parsed ties, so
every <tie> was dropped on serialization and a parse-then-write round trip
lost the tie information.

Add the ties to the child list in the slot the MusicXML content model
gives them, between <duration> and <voice>.

Co-authored-by: SheepYang1993 <15150244+SheepYang1993@users.noreply.github.com>
@thaihuynhxyz thaihuynhxyz self-assigned this Aug 7, 2026
@thaihuynhxyz
thaihuynhxyz merged commit 7a1f233 into main Aug 7, 2026
1 check passed
@thaihuynhxyz
thaihuynhxyz deleted the fix/note-tie-children branch August 7, 2026 14:07
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.

The "tie" tag will be lost after serialization

1 participant