Fix loading of certain version 5 serialized values #5829
Merged
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.
This fixes an oversight that was preventing loading of serialized values in the new format.
During loading, we check if we know all the references necessary to make sense of the values as values. So, for example, if you are loading a
Code, you just need to know theCodereference.Version 5 has all the references mentioned anywhere in the value lifted out to the top. At some point, I thought I could just return those, but this is wrong. For instance, a
Codevalue will have all the references mentioned in the code there. And a term link value will have the reference from the term link, which you do not need to have loaded in the runtime just to talk about the link (it would be impossible to ever load new code if this were the case).So, I've changed it back to doing the correct traversal and collecting the necessary references.
I also changed the
random-deserialtranscript to randomize the order we load different versions in. Those are the tests designed to catch problems like this, but since v4 was always loaded before v5, the references would always be known (because the v4 loading would add them).