-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve backward compatibility [de]serialize[From/To] fallback on Fw::Serializable and Fw::Buffer #3962
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
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.
This looks good to me, thanks for fixing this!
|
Why are we providing a default |
|
Also I have concerns about adding a new enumeration to the F Prime serialization interface in order to support the code above, which looks like a temporary workaround for an inconsistency between F Prime and FPP. |
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.
I would like to see my concerns addressed before this PR is merged.
|
I think the problem is here: Lines 29 to 46 in 60db7b2
We have deserialize calling deserialzeTo. This seems backwards, unless and until there is an FPP change. Without the FPP change, I think deserializeTo must be a convenience method that calls deserialize. It seems we are trying to change the interface without changing code that relies on the interface, and that is leading to a workaround and then another workaround to fix the first workaround.
|
|
Maybe the way forward is to merge this PR, merge nasa/fpp#766, and then fix up F Prime to remove the workarounds introduced in #3880 and this PR, including the UNIMPLEMENTED serialization status. Is there a clear path to doing all that before the next release? If so, that would address my concerns. |
|
@bocchino Yes, that is the plan that we discussed in the team meeting on Wednesday. The follow-up change to remove the work-arounds and DEPRECATE the legacy serialize and deserialize methods would be handled in #3944 . I will specifically note the UNIMPLEMENTED reversal in there now so we don't forget. |
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.
Thanks, the comments here and in #3944 have addressed my concerns. Please note my suggested changes to the comments in the code.
Co-authored-by: Rob Bocchino <[email protected]>
|
Yes, here's how I understand it
|
Related to #3944
We need this for nasa/fpp#766
In the FPP PR
serialize/deserializehas been ported[de]serialize[From/To]. In F Prime Serializable, to keep backwards compatibility we have a fallback clause in the default serializable/buffer:fprime/Fw/Types/Serializable.cpp
Lines 562 to 573 in 3dc73f9
The issue is that
FW_DESERIALIZE_FORMAT_ERRORis overloaded in use case for enums. When an enum deserialization is attempted and the value is not an enumerated constant in the enum type, the deserialization will returnFW_DESERIALIZE_FORMAT_ERROR. The current fallback code will cause a double deserialization (the same happens in the serialization code).This PR adds a new status code that disambiguates not implementing the deserialization with a format error.