fix: Don't lose references when deserializing subsequent AMF3 elements in AMF0 deserialization #66
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.
When AMF0 deserialization occurs a AMF3 Element Marker (0x11), it should save the references after deserialization and pass them to the deserializer when a subsequent AMF3 element is read. This PR implements this functionality.
An easier way to do this would be to: initialize the AMF3 Decoder, and add it as a property to AMF0 Decoder, then use it when a AMF3 element has been encountered, but since AMF3 can be switched on and off in the config, I had to think about an workaround.
Probably the same thing happens with writer, but since it doesn't break anything if not implemented properly we can ignore it, but I guess when implemented properly AMF3 with repeating elements wouldn't take as much space