-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore the track height when loading files #3692
Restore the track height when loading files #3692
Conversation
@LMMS/developers Does anyone know/remember what 3585927 was about? Or where to find information about the bug? @tobydox perhaps? If we cannot find out what it was about I propose to merge this one in the next few days. If we find a problem with the change later we will either fix the problem or revert the commit. |
@michaelgregorius here's the commit that introduced it d3d6d65 |
The track height is already stored for every file that is saved. Remove a condition that prevents its retrieval from files. The removed condition was added as a fix for an issue with the number #3585927 but it was not possible anymore to find out what this issue was about.
123592d
to
9e0e678
Compare
Rebased onto the current master (with the changes merged from 1.2). If no one objects I will merge this one soon. Seems like the secret of 3585927 will be lost forever. 😉 |
I'm still waiting for notes to randomly vanish... 😃 |
@zonkmachine Do you have some steps or an example file with which this behavior can be reproduced? |
No. I've tried but can't reproduce it on will. I'll try a bisect. |
Bug introduced here: 69947a6
|
@zonkmachine Good catch! Then I guess it's lines like this one that somehow create problems with tracks that have been saved with the smaller possible heights before the value for the minimum height got increased again. |
But the tracks that are wonky are saved with the wrong big size already. We both need a fix for the bug and an upgrade path to set all nutty tracks to default. |
if( element.attribute( "height" ).toInt() >= MINIMAL_TRACK_HEIGHT && | ||
element.attribute( "height" ).toInt() <= DEFAULT_TRACK_HEIGHT ) // workaround for #3585927, tobydox/2012-11-11 | ||
int storedHeight = element.attribute( "height" ).toInt(); | ||
if( storedHeight >= MINIMAL_TRACK_HEIGHT ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if( storedHeight >= MINIMAL_TRACK_HEIGHT && storedHeight < 400 )
This works as a quick dirty fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAXIMUM_TRACK_HEIGHT ≈ 200
?
@zonkmachine I think we should not add some conditional code again as this would confuse users who want to set one or more tracks to a very large height. If these users save their project and then load it again the height would not be the same as it was when it was saved. Can the saving with a height of 467 also be produced with current versions? If it was only a certain (released) version that produced these files we can check for this version during the load and correct the heights. Another interesting question is whether these corrupted files have been saved with an officially released version or with developer versions. If these files were produced using developer versions I would not care. In this case we should consider to just load and save the heights as they are and if a user has a corrupted file he/she can correct the heights and save again. |
I don't intend it as a fix but as to temporary contain the bug as it's annoying as hell. Not everybody needs to share the suffering.
So I have 60 cases and these are the projects that are uncompressed only.
Yes, the first one I saw was from a recent version. It's tempting enough to put an assert in there but the only place I don't want a crash is when saving. I think I'll test an assert anyway. PS. I think the bisect results are probably incorrect. I need to look into that further. |
@zonkmachine I think I have gotten a bit closer to the cause of the problem. First of all I'm also able to reproduce the problem with a fresh file and a current version of the software. For my test case I have the following tracks: The problems occurs with the following steps:
The first thing that I did to further investigate was to set a conditional break point in Then it dawned on me that perhaps some other class writes the faulty values into the XML. A quick search for |
Another method.
|
Some more debugging results: if you want to know why the switching of the instruments is relevant for the bug set a break point in When the instrument track is saved via Then This means that the attribute To solve this problem we will first have to clarify whether the two sets of data described above are saved in the correct place. It would also be helpful to understand what |
If you can find a way to trigger this without the instrument switch buttons, which was introduced rather recently, I can redo the bisect and get a better result. This bug is ever as amazing as I thought it would be when I first saw the title of it. It just keeps on giving... |
As for your latest report it is a bit beyond me but simpleSerializingMode was introduced here. |
@zonkmachine I have created #3721 to cover the bug because this pull request is already closed and therefore invisible. |
The track height is already stored for every file that is saved. Remove a
condition that prevents its retrieval from files.
The removed condition was added as a fix for an issue with the number
3585927 but it was not possible anymore to find out what this issue was
about.