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

Update documentation to explain why config:;standard() doesn't work with serde #506

Closed
Icelk opened this issue Feb 17, 2022 · 4 comments
Closed

Comments

@Icelk
Copy link

Icelk commented Feb 17, 2022

When I updated from beta-2 to beta-3, serialization and deserialization began to fail.
I get the error SkipFixedArrayLengthNotSupported.

See Icelk/agde#3 for the CI error. I'm not using any slices, just Vec.

This however works when serializing and deserializing using the standard methods and bincode::serde::Compat.

@VictorKoenders
Copy link
Contributor

It turned out there was an issue with serde and not being able to encode fixed sized arrays. bincode::config::standard() sets skip_fixed_array_length by default. Because serde does not tell us that a fixed size array is being (de)serialized, and we simply get a slice, there was no way to detect this.

Because of this, we had to hard bail any bincode::serde::* function if .skip_fixed_array_length was set. If you use bincode::config::standard().write_fixed_array_length() it should all world.

@Icelk
Copy link
Author

Icelk commented Feb 17, 2022

It now works as expected. Thanks for the swift reply and this library!

@Icelk Icelk closed this as completed Feb 17, 2022
@VictorKoenders
Copy link
Contributor

Gonna keep this open as a tracking issue to make the documentation more clear.

We should add a comment like my response on the following places:

@VictorKoenders VictorKoenders changed the title Regression in beta-3 Update documentation to explain why config:;standard() doesn't work with serde Feb 17, 2022
@VictorKoenders VictorKoenders added this to the v2.0 milestone Feb 17, 2022
@VictorKoenders
Copy link
Contributor

VictorKoenders commented Feb 28, 2022

We decided to make .write_fixed_array_header the default when using config::standard() so it would work better with serde

#509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants