[ECO-4970] Remove check for msg_serial
when converting protocol message to JSON
#437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This check is currently failing when calling
as_json
on an incomingMESSAGE
protocol message — for example, in the case where you receive a message whilst using debug-level logging.I’m not sure what was the intention of this check, which dates back to 523a4b1 (there, the error message is "(…) cannot generate valid JSON for ProtocolMessage"). It’s not clear to me why a
msgSerial
would be required in order to serialise a protocol message; I can only guess it was intended as some sort of a business logic sense check on outgoing messages.Perhaps, back then, it was the case that incoming
MESSAGE
protocol messages contained amsgSerial
, hence causing this check to succeed, but this is certainly no longer the case (even on protocol v1), nor can I see any good reason why it should be.Until aaa6211, this check could be (and was) satisfied by the presence of the
connectionSerial
attribute in the protocol message. That commit removed all references toconnectionSerial
and hence this check started failing.Given that there doesn’t seem to be a good reason for this check, remove it and hope that it wasn’t doing anything important.
Resolves #436.