fix: yaml, rollback trimming of the override tag when parsing collection index to ensure inputs can be re-used #2718
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.
PR Details
The parsing events, which are effectively tokens that the deserializer reads to create the final object, are mutated when deserializing. If you were to re-use those parsing events a second time, it would generate the same object, but the metadata would be partially lost.
A reader-like object should not be writing to the stream it is reading from.
The spot where it is called twice with the same parsing events is located here:
stride/sources/editor/Stride.Assets.Presentation/AssemblyReloading/GameStudioAssemblyReloader.cs
Lines 423 to 466 in 8d3547a
And it is because
stride/sources/editor/Stride.Assets.Presentation/AssemblyReloading/GameStudioAssemblyReloader.cs
Lines 300 to 305 in 8d3547a
Calls
ProcessObject
twice for the same object/path combination, once right in this scope, another one throughVisitObject
down the base call.I have another PR covering that scope.
Related Issue
Fix: #2716
The previous logic processed the objects twice, see the blurb about
ProcessObject
above. The first pass consumes the override tag when reading the yaml events because of thekey.Value = keyName;
therestride/sources/assets/Stride.Core.Assets/Yaml/AssetObjectSerializerBackend.cs
Lines 153 to 159 in 8d3547a
It would remove the override tag, so the next read would be without the override metadata, which in term gets the collection item removed as it is not part of its base asset.
Types of changes
Checklist