-
Notifications
You must be signed in to change notification settings - Fork 8
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 Buffer ser/de variant indices #261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be a unit test which verifies if the serde serialization code before and after #259 depends on the values of these numbers or not.
@andreisilviudragnea Do you mean if the serialized value depends on the variant indices? It probably does, given that you need to supply them as well in the deserialization implementation. @anton-lisanin mentioned that we are free to change the serialized format. It does not need to be backwards compatible. I do think it would be a good idea to assert that serializing and deserializing gives back something equivalent to the original, if we don't already have those tests. |
I know from previous experience that changing serialization code without unit tests is dangerous. The concrete serialization framework which should be tested here is |
That goes for pretty much any code 🤡 . So to your knowledge there are no unit tests for this. I suppose our integration tests should catch problems with the serialization but having it unit tested would give a better guarantee and earlier feedback. |
@andreisilviudragnea FYI added tests. |
We need to keep backward compatibility for deserialization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rejected.
With this code, it is not possible to deserialize from the buffer that was serialized in the previous version.
Ah I misunderstood you then. We should have tests to assert we can deserialize the old format in that case. This also means that |
This PR was made based on the assumption that we can make backwards incompatible changes to the serialized format which is not the case. I've opened #263 to implement unit tests which guarantee that the serialized data looks a certain way, and that serialized data from previous and the current version can be successfully deserialized. |
No description provided.