Fix broken EID links for parenthesis - #34555
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe 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)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped 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. Comment |
|
Sounds good to me, the tests just need updating |
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.