Skip to content

Fix broken EID links for parenthesis - #34555

Open
mike-spa wants to merge 1 commit into
musescore:mainfrom
mike-spa:fixBrokenEIDLinksForParenthesis
Open

Fix broken EID links for parenthesis#34555
mike-spa wants to merge 1 commit into
musescore:mainfrom
mike-spa:fixBrokenEIDLinksForParenthesis

Conversation

@mike-spa

Copy link
Copy Markdown
Contributor

Because we only write parenthesis if user modified, it can happen that the "main" element (e.g. the parenthesis in the notation stave) was not modified so it does not get written, but a linked element (e.g. the linked parenthesis in the TAB) was modified so it does get written. When writing the TAB parenthesis we try to link it to the EID of the main element, but because the main element was not written, its EID is invalid. In debug build this triggers an assertion failure when saving. In release build we save with an invalid EID which in debug builds will then trigger assertion failures on read.

I think it is safer to always write out the parenthesis, even if not strictly necessary, as it doesn't take that much space and it also allows to simplify the re-linking when reading.

Because we only write parenthesis if user modified, it can happen that the "main" element (e.g. the parenthesis in the notation stave) was not modified so it does not get written, but a linked element (e.g. the linked parenthesis in the TAB) was modified so it does get written. When writing the TAB parenthesis we try to link it to the EID of the main element, but because the main element was not written, its EID is invalid. In debug build this triggers an assertion failures when saving. In release build we save with an invalid EID which in debug builds will then trigger assertion failures on read.

I think it is safer to always write out the parenthesis, even if not strictly necessary, as it doesn't take that much space and it also allows to simplify the re-linking when reading.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 98903c78-4eda-439c-8c2b-67fec6a8035a

📥 Commits

Reviewing files that changed from the base of the PR and between 8a1c500 and 10c8d06.

📒 Files selected for processing (2)
  • src/engraving/rw/read500/tread.cpp
  • src/engraving/rw/write/twrite.cpp
💤 Files with no reviewable changes (1)
  • src/engraving/rw/read500/tread.cpp

📝 Walkthrough

Walkthrough

The change removes linked-chord synchronization for newly read note parentheses. It also changes chord note-parenthesis serialization to always write both the left and right parentheses, without checking whether each parenthesis was user-modified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug and fix, but it omits the required issue reference and all template checklist items. Add the issue reference and complete each required checklist item, including CLA, tests, coding rules, and unit or vtest coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing broken EID links for parenthesis elements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RomanPudashkin
RomanPudashkin requested a review from miiizen August 17, 2026 07:08
@miiizen

miiizen commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Sounds good to me, the tests just need updating

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