Repository navigation
Hand out the defaults when an older project has no automatic RT correction parameter - #837
Merged
htsugawa merged 1 commit intoOct 18, 2026
Conversation
…ction parameter AlignmentBaseParameter.AutomaticRtCorrection is MessagePack key 10, added after projects with keys 0-9 were saved. MessagePack 1.x gives an absent key its type's default rather than the member initialiser, so such a project loaded it as null and the parameter export threw (AutomaticRtCorrection.get returned null); the GUI's LC-MS alignment view reads it the same way. The getter now hands out the defaults when the value is null, put in place once and atomically, as LipidRtCheckParam already does. An older project therefore exports its parameters and aligns with automatic RT correction off, as it was saved. A stored value is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
MsdialGuiAppTests (Release, net48) on this branch: 197 passed, 0 failed. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a project saved before automatic alignment RT correction existed, and exporting its parameters, throws:
AlignmentBaseParameter.AutomaticRtCorrectionis MessagePack key 10, added after projects with keys 0-9 were saved. MessagePack 1.x gives an absent key its type's default (null), not the member initialiser, so the nested parameter loads as null.ParameterBase.ParametersAsTextdereferences it (the "Execute automatic RT correction for alignment" line and the 15 after it), and so does the GUI'sLcmsAlignmentModel(AutomaticRtCorrection.Execute), so the same project would also fail when its LC-MS alignment opens.Fix
The getter hands out the defaults when the value is null, put in place once and atomically, the same way
ParameterBase.LipidRtCheckParamalready handles its key 18. An older project therefore exports its parameters and aligns with automatic RT correction off, as it was saved. A stored value is kept, and the MessagePack layout is unchanged.Tests
New
MsdialCoreTests/Parameter/AlignmentBaseParameterTests, using the existing pattern of saving with a type that predates the key and loading as the current type:ParametersAsText()no longer throws;AutomaticRtCorrectionround-trips;Without the fix, 3 of the 4 fail, and the export test fails with the NullReferenceException reported above.
Local runs (Release):
🤖 Generated with Claude Code