Improve backward compatibility [de]serialize[From/To] fallback on Fw::Serializable and Fw::Buffer#3962
Conversation
vincewoo
left a comment
There was a problem hiding this comment.
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. |
bocchino
left a comment
There was a problem hiding this comment.
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. |
Co-authored-by: Rob Bocchino <bocchino@icloud.com>
|
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.