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

[ECO-4970] Remove check for msg_serial when converting protocol message to JSON #437

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Sep 10, 2024

This check is currently failing when calling as_json on an incoming MESSAGE 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 a msgSerial, 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 to connectionSerial 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.

@github-actions github-actions bot temporarily deployed to staging/pull/437/docs September 10, 2024 20:17 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/437/features September 10, 2024 20:18 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/437/docs September 10, 2024 20:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/437/features September 10, 2024 20:20 Inactive
This check is currently failing when calling as_json on an incoming
MESSAGE 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 a msgSerial, 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 to connectionSerial 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.
@sacOO7
Copy link
Contributor

sacOO7 commented Sep 11, 2024

We have already removed similar check as a part of protocol 2 work, so we should be good 7a04abc

Copy link
Contributor

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@lawrence-forooghian lawrence-forooghian merged commit 362b4d8 into main Sep 11, 2024
23 checks passed
@lawrence-forooghian lawrence-forooghian deleted the 436-debug-log-exception branch September 11, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Incoming MESSAGE causes exception when debug-level logging enabled
2 participants