Skip to content
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

Fix property parsing when a property contains a struct #210

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

knutwalker
Copy link
Collaborator

Properties are parsed lazily by deserializing the data into an IgnoredAny
and then returning the bytes that have been read.

We do parse structs as an enum in order to emit the struct tag as enum tag.
The IgnoredAny then deserializes a newtype enum variant, expecting a single item.
The VariantAccess impl for the packstream deserializer would then only emit the next field in the struct, introducing the bug.
The fix is to emit all fields when the list of items is from a struct and we are parsing properties.

Fixes #209

@knutwalker knutwalker merged commit d719bd1 into main Jan 9, 2025
11 checks passed
@knutwalker knutwalker deleted the skip-over-all-struct-fields branch January 9, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when I enable the feature [unstable-v1], I am unable to parse properties with certain struct values.
1 participant